Skip to content

Commit

Permalink
Implement xeno weed_food
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Dec 4, 2023
1 parent 94ef4d0 commit 11f05f4
Show file tree
Hide file tree
Showing 25 changed files with 105 additions and 12 deletions.
20 changes: 11 additions & 9 deletions code/datums/components/weed_food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@
gender = PLURAL
vis_flags = VIS_INHERIT_DIR|VIS_INHERIT_PLANE|VIS_INHERIT_LAYER
icon = 'icons/mob/xenos/weeds.dmi'
var/static/list/icon_states = list("human_1","human_2","human_3","human_4","human_5")
var/static/list/icon_states_flipped = list("human_1_f","human_2_f","human_3_f","human_4_f","human_5_f")
var/list/icon_states
var/list/icon_states_flipped
var/icon_state_idx = 0
var/timer_id = null
var/flipped = FALSE

/atom/movable/vis_obj/weed_food/Initialize(mapload, is_flipped, ...)
/atom/movable/vis_obj/weed_food/Initialize(mapload, is_flipped, weeds_icon, states, states_flipped, ...)
flipped = is_flipped
icon = weeds_icon
icon_states = states
icon_states_flipped = states_flipped
timer_id = addtimer(CALLBACK(src, PROC_REF(on_animation_timer)), WEED_FOOD_STATE_DELAY, TIMER_STOPPABLE|TIMER_UNIQUE|TIMER_LOOP|TIMER_DELETE_ME)
on_animation_timer()
return ..()

/// Timer callback for changing the icon_state
/atom/movable/vis_obj/weed_food/proc/on_animation_timer()
icon_state_idx++
// Assumption: Length of icon_states is the same as icon_states_flipped
if(icon_state_idx > length(icon_states))
deltimer(timer_id)
timer_id = null
Expand Down Expand Up @@ -57,10 +61,9 @@

/datum/component/weed_food/Initialize(...)
parent_mob = parent
//if(!istype(parent_mob))
//return COMPONENT_INCOMPATIBLE
if(!istype(parent_mob, /mob/living/carbon/human))
return COMPONENT_INCOMPATIBLE // TODO: At the moment we only support humans
// At the moment we only support humans and xenos
if(!istype(parent_mob, /mob/living/carbon/human) && !istype(parent_mob, /mob/living/carbon/xenomorph))
return COMPONENT_INCOMPATIBLE

parent_turf = get_turf(parent_mob)
if(parent_turf != parent_mob.loc)
Expand Down Expand Up @@ -270,9 +273,8 @@
var/is_flipped = parent_mob.transform.b == -1 // Technically we should check if d is 1 too, but corpses can only be rotated 90 or 270 (1/-1 or -1/1)
if(parent_mob.dir & WEST)
is_flipped = !is_flipped // The direction reversed the effect of the flip!
weed_appearance = new(null, is_flipped)
weed_appearance = new(null, is_flipped, parent_mob.weed_food_icon, parent_mob.weed_food_states, parent_mob.weed_food_states_flipped)
weed_appearance.color = absorbing_weeds.color
// TODO: For non-humans change the icon_state or something here
parent_mob.vis_contents += weed_appearance

return TRUE
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Boiler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
icon_xeno = 'icons/mob/xenos/boiler.dmi'
icon_xenonid = 'icons/mob/xenonids/boiler.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
weed_food_states = list("Boiler_1","Boiler_2","Boiler_3")
weed_food_states_flipped = list("Boiler_1","Boiler_2","Boiler_3")

var/datum/effect_system/smoke_spread/xeno_acid/smoke

base_actions = list(
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Burrower.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
icon_xeno = 'icons/mob/xenos/burrower.dmi'
icon_xenonid = 'icons/mob/xenonids/burrower.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
weed_food_states = list("Burrower_1","Burrower_2","Burrower_3")
weed_food_states_flipped = list("Burrower_1","Burrower_2","Burrower_3")

/mob/living/carbon/xenomorph/burrower/Initialize(mapload, mob/living/carbon/xenomorph/oldxeno, h_number)
. = ..()
sight |= SEE_TURFS
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Carrier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@

icon_xenonid = 'icons/mob/xenonids/carrier.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
weed_food_states = list("Carrier_1","Carrier_2","Carrier_3")
weed_food_states_flipped = list("Carrier_1","Carrier_2","Carrier_3")

var/list/hugger_image_index = list()
var/mutable_appearance/hugger_overlays_icon
var/mutable_appearance/eggsac_overlays_icon
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Crusher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@
mutation_icon_state = CRUSHER_NORMAL
mutation_type = CRUSHER_NORMAL

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
icon_xeno = 'icons/mob/xenos/crusher.dmi'
icon_xenonid = 'icons/mob/xenonids/crusher.dmi'

weed_food_states = list("Crusher_1","Crusher_2","Crusher_3")
weed_food_states_flipped = list("Crusher_1","Crusher_2","Crusher_3")

// Refactored to handle all of crusher's interactions with object during charge.
/mob/living/carbon/xenomorph/proc/handle_collision(atom/target)
if(!target)
Expand Down
7 changes: 7 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Defender.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
pixel_x = -16
old_x = -16
tier = 1

base_actions = list(
/datum/action/xeno_action/onclick/xeno_resting,
/datum/action/xeno_action/onclick/regurgitate,
Expand All @@ -49,11 +50,17 @@
/datum/action/xeno_action/activable/fortify,
/datum/action/xeno_action/onclick/tacmap,
)

mutation_icon_state = DEFENDER_NORMAL
mutation_type = DEFENDER_NORMAL

icon_xeno = 'icons/mob/xenos/defender.dmi'
icon_xenonid = 'icons/mob/xenonids/defender.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
weed_food_states = list("Defender_1","Defender_2","Defender_3")
weed_food_states_flipped = list("Defender_1","Defender_2","Defender_3")

/mob/living/carbon/xenomorph/defender/handle_special_state()
if(fortify)
return TRUE
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Drone.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@

icon_xeno = 'icons/mob/xenos/drone.dmi'
icon_xenonid = 'icons/mob/xenonids/drone.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_48x48.dmi'
weed_food_states = list("Drone_1","Drone_2","Drone_3")
weed_food_states_flipped = list("Drone_1","Drone_2","Drone_3")
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Facehugger.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
icon_xeno = 'icons/mob/xenos/facehugger.dmi'
icon_xenonid = 'icons/mob/xenonids/facehugger.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_48x48.dmi'
weed_food_states = list("Facehugger_1","Facehugger_2","Facehugger_3")
weed_food_states_flipped = list("Facehugger_1","Facehugger_2","Facehugger_3")

/mob/living/carbon/xenomorph/facehugger/initialize_pass_flags(datum/pass_flags_container/PF)
..()
if (PF)
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Hellhound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@
)
mutation_type = HELLHOUND_NORMAL

weed_food_icon = 'icons/mob/xenos/weeds.dmi'
icon_xeno = 'icons/mob/xenos/hellhound.dmi'
icon_xenonid = 'icons/mob/xenos/hellhound.dmi'

weed_food_states = list("Hellhound_1","Hellhound_2","Hellhound_3")
weed_food_states_flipped = list("Hellhound_1","Hellhound_2","Hellhound_3")

/mob/living/carbon/xenomorph/hellhound/Initialize(mapload, mob/living/carbon/xenomorph/oldXeno, h_number)
. = ..(mapload, oldXeno, h_number || XENO_HIVE_YAUTJA)

Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Hivelord.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
mob_size = MOB_SIZE_BIG
drag_delay = 6 //pulling a big dead xeno is hard
tier = 2

base_actions = list(
/datum/action/xeno_action/onclick/xeno_resting,
/datum/action/xeno_action/onclick/regurgitate,
Expand All @@ -75,11 +76,16 @@
/mob/living/carbon/xenomorph/proc/rename_tunnel,
/mob/living/carbon/xenomorph/proc/set_hugger_reserve_for_morpher,
)

mutation_type = HIVELORD_NORMAL

icon_xeno = 'icons/mob/xenos/hivelord.dmi'
icon_xenonid = 'icons/mob/xenonids/hivelord.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
weed_food_states = list("Hivelord_1","Hivelord_2","Hivelord_3")
weed_food_states_flipped = list("Hivelord_1","Hivelord_2","Hivelord_3")

/datum/behavior_delegate/hivelord_base
name = "Base Hivelord Behavior Delegate"

Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
icon_xeno = 'icons/mob/xenos/lurker.dmi'
icon_xenonid = 'icons/mob/xenonids/lurker.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_48x48.dmi'
weed_food_states = list("Drone_1","Drone_2","Drone_3")
weed_food_states_flipped = list("Drone_1","Drone_2","Drone_3")

/datum/behavior_delegate/lurker_base
name = "Base Lurker Behavior Delegate"

Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Praetorian.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@
icon_xeno = 'icons/mob/xenos/praetorian.dmi'
icon_xenonid = 'icons/mob/xenonids/praetorian.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
weed_food_states = list("Praetorian_1","Praetorian_2","Praetorian_3")
weed_food_states_flipped = list("Praetorian_1","Praetorian_2","Praetorian_3")

/datum/behavior_delegate/praetorian_base
name = "Base Praetorian Behavior Delegate"
///reward for hitting shots instead of spamming acid ball
Expand Down
7 changes: 6 additions & 1 deletion code/modules/mob/living/carbon/xenomorph/castes/Predalien.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@
/datum/action/xeno_action/activable/devastate,
/datum/action/xeno_action/onclick/tacmap,
)

mutation_type = "Normal"

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
weed_food_states = list("Predalien_1","Predalien_2","Predalien_3")
weed_food_states_flipped = list("Predalien_1","Predalien_2","Predalien_3")

var/butcher_time = 6 SECONDS


Expand Down Expand Up @@ -147,7 +152,7 @@ Your health meter will not regenerate normally, so kill and die for the hive!</s
for(var/i in 1 to 3)
var/obj/item/reagent_container/food/snacks/meat/new_meat = new flesh_type(human_victim.loc)
new_meat.name = "[human_victim.name] [flesh]"


else if (isxeno(victim))
var/mob/living/carbon/xenomorph/xeno_victim = victim
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Queen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@
icon_xeno = 'icons/mob/xenos/queen.dmi'
icon_xenonid = 'icons/mob/xenonids/queen.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
weed_food_states = list("Queen_1","Queen_2","Queen_3")
weed_food_states_flipped = list("Queen_1","Queen_2","Queen_3")

var/breathing_counter = 0
var/ovipositor = FALSE //whether the Queen is attached to an ovipositor
var/queen_ability_cooldown = 0
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Ravager.dm
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
icon_xeno = 'icons/mob/xenos/ravager.dmi'
icon_xenonid = 'icons/mob/xenonids/ravager.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
weed_food_states = list("Ravager_1","Ravager_2","Ravager_3")
weed_food_states_flipped = list("Ravager_1","Ravager_2","Ravager_3")


// Mutator delegate for base ravager
/datum/behavior_delegate/ravager_base
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Runner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
icon_xeno = 'icons/mob/xenos/runner.dmi'
icon_xenonid = 'icons/mob/xenonids/runner.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
weed_food_states = list("Runner_1","Runner_2","Runner_3")
weed_food_states_flipped = list("Runner_1","Runner_2","Runner_3")


/mob/living/carbon/xenomorph/runner/initialize_pass_flags(datum/pass_flags_container/pass_flags_container)
..()
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Sentinel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
icon_xeno = 'icons/mob/xenos/sentinel.dmi'
icon_xenonid = 'icons/mob/xenonids/sentinel.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_48x48.dmi'
weed_food_states = list("Drone_1","Drone_2","Drone_3")
weed_food_states_flipped = list("Drone_1","Drone_2","Drone_3")

/datum/behavior_delegate/sentinel_base
name = "Base Sentinel Behavior Delegate"

Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Spitter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@

icon_xeno = 'icons/mob/xenos/spitter.dmi'
icon_xenonid = 'icons/mob/xenonids/spitter.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_48x48.dmi'
weed_food_states = list("Drone_1","Drone_2","Drone_3")
weed_food_states_flipped = list("Drone_1","Drone_2","Drone_3")
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/xenomorph/castes/Warrior.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,16 @@

mutation_type = WARRIOR_NORMAL
claw_type = CLAW_TYPE_SHARP

icon_xeno = 'icons/mob/xenos/warrior.dmi'
icon_xenonid = 'icons/mob/xenonids/warrior.dmi'

weed_food_icon = 'icons/mob/xenos/weeds_64x64.dmi'
weed_food_states = list("Warrior_1","Warrior_2","Warrior_3")
weed_food_states_flipped = list("Warrior_1","Warrior_2","Warrior_3")

var/lunging = FALSE // whether or not the warrior is currently lunging (holding) a target

/mob/living/carbon/xenomorph/warrior/throw_item(atom/target)
toggle_throw_mode(THROW_MODE_OFF)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
icon_xeno = 'icons/mob/xenos/lesser_drone.dmi'
icon_xenonid = 'icons/mob/xenonids/lesser_drone.dmi'

weed_food_icon = 'icons/mob/xenos/weeds.dmi'
weed_food_states = list("Lesser_Drone_1","Lesser_Drone_2","Lesser_Drone_3")
weed_food_states_flipped = list("Lesser_Drone_1","Lesser_Drone_2","Lesser_Drone_3")

/mob/living/carbon/xenomorph/lesser_drone/age_xeno()
if(stat == DEAD || !caste || QDELETED(src) || !client)
return
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/xenomorph/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@

if(hardcore)
QDEL_IN(src, 3 SECONDS)
//else if(!gibbed) // At the moment we only support humans
//AddComponent(/datum/component/weed_food)
else if(!gibbed)
AddComponent(/datum/component/weed_food)

if(hive)
hive.remove_xeno(src)
Expand Down
7 changes: 7 additions & 0 deletions code/modules/mob/living/living_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,10 @@
/// Flags that determine the potential of a mob to perform certain actions. Do not change this directly.
var/mobility_flags = MOBILITY_FLAGS_DEFAULT

/// icon for weed_food states
var/weed_food_icon = 'icons/mob/xenos/weeds.dmi'
/// icon_states for weed_food (needs to be the same length as weed_food_states_flipped)
var/list/weed_food_states = list("human_1","human_2","human_3","human_4","human_5")
/// flipped icon_states for weed_food (needs to be the same length as weed_food_states)
var/list/weed_food_states_flipped = list("human_1_f","human_2_f","human_3_f","human_4_f","human_5_f")

Binary file modified icons/mob/xenos/weeds.dmi
Binary file not shown.
Binary file added icons/mob/xenos/weeds_48x48.dmi
Binary file not shown.
Binary file added icons/mob/xenos/weeds_64x64.dmi
Binary file not shown.

0 comments on commit 11f05f4

Please sign in to comment.