-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bring back halloween carvable pumpkin helmets
- Loading branch information
Showing
5 changed files
with
149 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/// Patches of pumpkins spawned at roundstart from where marines can get their carvable pumpkins | ||
/obj/structure/pumpkin_patch | ||
icon = 'icons/misc/events/pumpkins.dmi' | ||
name = "patch of pumpkins" | ||
|
||
can_block_movement = FALSE | ||
unslashable = TRUE | ||
health = 400 // To avoid explosions and stray gunfire destroying them too easily | ||
layer = LOWER_ITEM_LAYER | ||
|
||
var/has_vines = TRUE //! Whether there's still vines to display or not | ||
var/pumpkin_count = 3 //! Amount of pumpkins currently in the patch | ||
var/icon_prefix //! Prefix to prepend to icon states, for corrupted pumpkins | ||
var/pumpkin_type = /obj/item/clothing/head/pumpkin | ||
|
||
/obj/structure/pumpkin_patch/Initialize(mapload, ...) | ||
. = ..() | ||
update_icon() | ||
|
||
/obj/structure/pumpkin_patch/update_icon() | ||
overlays?.Cut() | ||
. = ..() | ||
switch(pumpkin_count) | ||
if(3) icon_state = "[icon_prefix]pumpkins_full" | ||
if(2) icon_state = "[icon_prefix]pumpkins_half" | ||
if(1) icon_state = "[icon_prefix]pumpkin" | ||
else icon_state = "" | ||
if(has_vines) | ||
overlays += image(icon, loc, "[icon_prefix]vines") | ||
|
||
/obj/structure/pumpkin_patch/attack_hand(mob/user) | ||
if(pumpkin_count < 1) | ||
to_chat(user, SPAN_WARNING("No more pumpkins here...")) | ||
return | ||
if(!user.get_active_hand()) //if active hand is empty | ||
pumpkin_count-- | ||
var/obj/item/clothing/head/pumpkin/pumpkin = new pumpkin_type(loc) | ||
user.put_in_hands(pumpkin) | ||
update_icon() | ||
if(pumpkin_count < 1 && !has_vines) | ||
qdel(src) | ||
return | ||
return ..() | ||
|
||
/obj/structure/pumpkin_patch/attackby(obj/item/tool, mob/user) | ||
if(has_vines && (tool.sharp == IS_SHARP_ITEM_ACCURATE || tool.sharp == IS_SHARP_ITEM_BIG)) | ||
to_chat(user, SPAN_NOTICE("You cut down the vines.")) | ||
has_vines = FALSE | ||
update_icon() | ||
if(pumpkin_count < 1 && !has_vines) | ||
qdel(src) | ||
return | ||
return ..() | ||
|
||
/obj/structure/pumpkin_patch/corrupted | ||
icon_prefix = "cor_" | ||
name = "patch of corrupted pumpkins" | ||
pumpkin_type = /obj/item/clothing/head/pumpkin/corrupted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/// Carved Pumpkin from the Halloween event | ||
/obj/item/clothing/head/pumpkin | ||
name = "pumpkin" | ||
icon = 'icons/misc/events/pumpkins.dmi' | ||
item_icons = list( | ||
WEAR_HEAD = 'icons/misc/events/pumpkins.dmi', | ||
) | ||
w_class = SIZE_MEDIUM | ||
flags_inventory = COVEREYES|COVERMOUTH | ||
flags_inv_hide = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEALLHAIR | ||
flags_armor_protection = BODY_FLAG_HEAD|BODY_FLAG_EYES | ||
var/prefix = "" //! Icon state prefix for corrupted pumpkin variants | ||
var/carved_icon = "" //! Currently carved pumpkin overlay | ||
var/carvable_icons = list("smile", "cheeky", "bugeyes", "upside_down_smile", "skelly", "ff") | ||
|
||
/obj/item/clothing/head/pumpkin/Initialize(mapload, ...) | ||
. = ..() | ||
update_icon() | ||
|
||
/obj/item/clothing/head/pumpkin/update_icon() | ||
. = ..() | ||
if(carved_icon) | ||
icon_state = "[prefix]pumpkin_carved" | ||
else | ||
icon_state = "[prefix]pumpkin" | ||
item_state_slots = list( | ||
WEAR_HEAD = "[prefix]pumpkin_onmob", | ||
) | ||
|
||
/obj/item/clothing/head/pumpkin/mob_can_equip(mob/user, slot, disable_warning) | ||
if(slot == WEAR_HEAD && !carved_icon) | ||
to_chat(user, SPAN_WARNING("You can't put on a full pumpkin! Empty and carve it with a sharp object first.")) | ||
return FALSE | ||
. = ..() | ||
|
||
/obj/item/clothing/head/pumpkin/attackby(obj/item/tool, mob/user) | ||
if(!carved_icon && (tool.sharp == IS_SHARP_ITEM_ACCURATE || tool.sharp == IS_SHARP_ITEM_BIG)) | ||
var/choice = tgui_input_list(user, "Select the pattern to carve on your pumpkin!", "Pumpkin Carving", carvable_icons) | ||
if(choice) | ||
carved_icon = choice | ||
name = "carved pumpkin" | ||
update_icon() | ||
else | ||
return ..() | ||
|
||
/obj/item/clothing/head/pumpkin/get_mob_overlay(mob/user_mob, slot) | ||
var/image/pumpkin = ..() | ||
if(carved_icon && slot == WEAR_HEAD) | ||
var/image/overlay = overlay_image(icon, "[prefix]pumpkin_[carved_icon]") | ||
pumpkin.overlays += overlay | ||
return pumpkin | ||
|
||
/obj/item/clothing/head/pumpkin/corrupted | ||
prefix = "cor_" | ||
carvable_icons = list("cry", "sob", "sad", "why", "spooky", "ff") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.