Skip to content

Commit

Permalink
Halloween update Remade (#8527)
Browse files Browse the repository at this point in the history
* Halloween update Remade

* Update roach.dm

Maybe fix to integration test
  • Loading branch information
AltHit authored Oct 1, 2024
1 parent 8baab49 commit df81fe2
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 0 deletions.
55 changes: 55 additions & 0 deletions code/game/objects/items/weapons/storage/boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -637,3 +637,58 @@
icon_state = "packet_njoy_green"
item_state = "packet_njoy_green"
prespawned_content_type = /obj/item/storage/pill_bottle/njoy/green




/obj/item/storage/box/halloween_basket
name = "festive basket"
desc = "How did the roaches even get those? Well, it\'s yours now!"
icon_state = "pumpkin_box_1"
var/list/loots = list(
/obj/item/reagent_containers/food/snacks/sliceable/plaincake = 5,
/obj/item/reagent_containers/food/snacks/sliceable/chocolatecake = 5,
/obj/item/reagent_containers/food/snacks/cinnamonroll = 20,
/obj/item/reagent_containers/food/snacks/candy_corn = 20,
/obj/item/reagent_containers/food/snacks/chocolatebar = 10,
/obj/item/reagent_containers/food/snacks/donut = 10,
/obj/item/reagent_containers/food/snacks/donut/chaos = 3,
/obj/item/reagent_containers/food/snacks/cookie = 10,
/obj/item/reagent_containers/food/snacks/brownieslice = 10,
/obj/item/reagent_containers/food/snacks/chocolateegg = 10,
/obj/item/reagent_containers/food/snacks/candy/mre = 5,
/obj/item/reagent_containers/food/snacks/candiedapple = 10,
/obj/item/reagent_containers/food/snacks/appletart = 10
)

/obj/item/storage/box/halloween_basket/proc/get_loot()
var/items_to_spawn = rand(3, 5)
var/list/goodies = list()
while(items_to_spawn > 0)
items_to_spawn--
goodies += pickweight(loots)
return goodies

/obj/item/storage/box/halloween_basket/New()
. = ..()
icon_state = "pumpkin_box_[rand(1,6)]"
add_overlay("candy[rand(1,3)]")
item_state = "pumpkin_box"
var/list/things2spawn = list()
things2spawn += get_loot()
things2spawn += pick(subtypesof(/obj/item/toy/plushie) + subtypesof(/obj/item/toy/figure))

if(prob(5)) //Special drops!

if(prob(50))
things2spawn += /obj/item/reagent_containers/syringe/drugs_recreational
else if(prob(40))
things2spawn += /obj/item/reagent_containers/syringe/stim/grape_drops
else if(prob(30))
things2spawn += /obj/item/reagent_containers/syringe/stim/violence_ultra
else if(prob(20)) //Due to else-ifs this actually has a far smaller chance of dropping
things2spawn += /obj/item/gun/projectile/automatic/dallas
else
things2spawn += /obj/item/stack/material/sandstone //You got a rock.
for(var/path in things2spawn)
new path(src)
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/mob/living/carbon/superior_animal/roach/Move()
. = ..()
update_hat()
if(buckled_mob)
buckled_mob.dir = dir
buckled_mob.forceMove(get_turf(src))
Expand Down
71 changes: 71 additions & 0 deletions code/modules/mob/living/carbon/superior_animal/roach/roach.dm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,32 @@
var/busy_time // how long it will take to eat/lay egg
var/busy_start_time // when it started eating/laying egg

var/obj/item/hat
var/hat_x_offset = 6
var/hat_y_offset = 8

var/list/hats4roaches = list(/obj/item/clothing/head/collectable/chef,
/obj/item/clothing/head/collectable/paper,
/obj/item/clothing/head/collectable/beret,
/obj/item/clothing/head/collectable/welding,
/obj/item/clothing/head/collectable/flatcap,
/obj/item/clothing/head/collectable/pirate,
/obj/item/clothing/head/collectable/thunderdome,
/obj/item/clothing/head/collectable/swat,
/obj/item/clothing/head/collectable/police,
/obj/item/clothing/head/collectable/xenom,
/obj/item/clothing/head/collectable/petehat,
/obj/item/clothing/head/collectable/wizard,
/obj/item/clothing/head/collectable/hardhat,
/obj/item/clothing/head/fedora,
/obj/item/clothing/head/hasturhood,
/obj/item/clothing/head/hgpiratecap,
/obj/item/clothing/head/nursehat,
/obj/item/clothing/head/soft/rainbow,
/obj/item/clothing/head/soft/grey
)


// Armor related variables
armor = list(
melee = 0,
Expand All @@ -57,6 +83,12 @@
rad = 50
)

/mob/living/carbon/superior_animal/roach/New()
. = ..()
var/newhat = pick(hats4roaches)
var/obj/item/hatobj = new newhat(loc)
wear_hat(hatobj)

/mob/living/carbon/superior_animal/roach/Destroy()
clearEatTarget()
return ..()
Expand All @@ -74,3 +106,42 @@
if(prob(3))
visible_message(SPAN_DANGER("\the [src] hacks up a tape!"))
new /obj/item/music_tape(get_turf(src))

else if(prob(10))
visible_message(SPAN_DANGER("\the [src] drops behind a gift basket!"))
new /obj/item/storage/box/halloween_basket(get_turf(src))

if(hat)
hat.loc = get_turf(src)
hat.update_plane()
hat = null
update_hat()



/mob/living/carbon/superior_animal/roach/proc/wear_hat(var/obj/item/new_hat)
if(hat)
return
hat = new_hat
new_hat.forceMove(src)
update_hat()

/mob/living/carbon/superior_animal/roach/proc/update_hat()
overlays.Cut()
if(hat)
var/offset_x = hat_x_offset
var/offset_y = hat_y_offset
switch(dir)
if(EAST)
offset_y = -hat_y_offset
offset_x = hat_x_offset
if(WEST)
offset_y = -hat_y_offset
offset_x = -hat_x_offset
if(NORTH)
offset_y = -2
offset_x = 0
if(SOUTH)
offset_y = -16
offset_x = 0
overlays |= get_hat_icon(hat, offset_x, offset_y)
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
var/distress_calls = 1 //Each fuhrer can only call for help once in its life
var/retreat_calls = 1 //Can call for retreat once too

hats4roaches = list(/obj/item/clothing/head/collectable/captain,
/obj/item/clothing/head/collectable/tophat)

// Armor related variables
armor = list(
melee = 10,
Expand Down
Binary file modified icons/mob/items/lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/items/righthand.dmi
Binary file not shown.
Binary file modified icons/obj/storage/boxes.dmi
Binary file not shown.

0 comments on commit df81fe2

Please sign in to comment.