Adds action buttons for spiders, refactors action code, nurse spiders can set a hereditary directive for their children to follow
This commit is contained in:
@@ -10,15 +10,15 @@ Doesn't work on other aliens/AI.*/
|
||||
name = "Alien Power"
|
||||
panel = "Alien"
|
||||
var/plasma_cost = 0
|
||||
var/check_turf = 0
|
||||
var/has_action = 1
|
||||
var/datum/action/spell_action/alien/action = null
|
||||
var/action_icon = 'icons/mob/actions/actions_xeno.dmi'
|
||||
var/action_icon_state = "spell_default"
|
||||
var/action_background_icon_state = "bg_alien"
|
||||
var/check_turf = FALSE
|
||||
has_action = TRUE
|
||||
datum/action/spell_action/alien/action
|
||||
action_icon = 'icons/mob/actions/actions_xeno.dmi'
|
||||
action_icon_state = "spell_default"
|
||||
action_background_icon_state = "bg_alien"
|
||||
|
||||
/obj/effect/proc_holder/alien/New()
|
||||
..()
|
||||
/obj/effect/proc_holder/alien/Initialize()
|
||||
. = ..()
|
||||
action = new(src)
|
||||
|
||||
/obj/effect/proc_holder/alien/Click()
|
||||
@@ -30,15 +30,20 @@ Doesn't work on other aliens/AI.*/
|
||||
user.adjustPlasma(-plasma_cost)
|
||||
return 1
|
||||
|
||||
/obj/effect/proc_holder/alien/proc/on_gain(mob/living/carbon/user)
|
||||
/obj/effect/proc_holder/alien/on_gain(mob/living/carbon/user)
|
||||
return
|
||||
|
||||
/obj/effect/proc_holder/alien/proc/on_lose(mob/living/carbon/user)
|
||||
/obj/effect/proc_holder/alien/on_lose(mob/living/carbon/user)
|
||||
return
|
||||
|
||||
/obj/effect/proc_holder/alien/proc/fire(mob/living/carbon/user)
|
||||
/obj/effect/proc_holder/alien/fire(mob/living/carbon/user)
|
||||
return 1
|
||||
|
||||
/obj/effect/proc_holder/alien/get_panel_text()
|
||||
. = ..()
|
||||
if(plasma_cost > 0)
|
||||
return "[plasma_cost]"
|
||||
|
||||
/obj/effect/proc_holder/alien/proc/cost_check(check_turf=0,mob/living/carbon/user,silent = 0)
|
||||
if(user.stat)
|
||||
if(!silent)
|
||||
@@ -168,7 +173,6 @@ Doesn't work on other aliens/AI.*/
|
||||
if(user.getPlasma() > A.plasma_cost && A.corrode(O))
|
||||
user.adjustPlasma(-A.plasma_cost)
|
||||
|
||||
|
||||
/obj/effect/proc_holder/alien/neurotoxin
|
||||
name = "Spit Neurotoxin"
|
||||
desc = "Spits neurotoxin at someone, paralyzing them for a short time."
|
||||
@@ -179,7 +183,7 @@ Doesn't work on other aliens/AI.*/
|
||||
var/message
|
||||
if(active)
|
||||
message = "<span class='notice'>You empty your neurotoxin gland.</span>"
|
||||
remove_ranged_ability(user,message)
|
||||
remove_ranged_ability(message)
|
||||
else
|
||||
message = "<span class='notice'>You prepare your neurotoxin gland. <B>Left-click to fire at a target!</B></span>"
|
||||
add_ranged_ability(user, message, TRUE)
|
||||
@@ -193,7 +197,7 @@ Doesn't work on other aliens/AI.*/
|
||||
return
|
||||
var/p_cost = 50
|
||||
if(!iscarbon(ranged_ability_user) || ranged_ability_user.lying || ranged_ability_user.stat)
|
||||
remove_ranged_ability(ranged_ability_user)
|
||||
remove_ranged_ability()
|
||||
return
|
||||
|
||||
var/mob/living/carbon/user = ranged_ability_user
|
||||
@@ -219,8 +223,7 @@ Doesn't work on other aliens/AI.*/
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/alien/neurotoxin/on_lose(mob/living/carbon/user)
|
||||
if(user.ranged_ability == src)
|
||||
user.ranged_ability = null
|
||||
remove_ranged_ability()
|
||||
|
||||
/obj/effect/proc_holder/alien/neurotoxin/add_ranged_ability(mob/living/user, msg)
|
||||
..()
|
||||
@@ -328,7 +331,3 @@ Doesn't work on other aliens/AI.*/
|
||||
return 1
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
/proc/cmp_abilities_cost(obj/effect/proc_holder/alien/a, obj/effect/proc_holder/alien/b)
|
||||
return b.plasma_cost - a.plasma_cost
|
||||
|
||||
@@ -425,23 +425,6 @@
|
||||
var/turf/target = get_turf(loc)
|
||||
I.throw_at(target,I.throw_range,I.throw_speed,src)
|
||||
|
||||
/mob/living/carbon/proc/AddAbility(obj/effect/proc_holder/alien/A)
|
||||
abilities.Add(A)
|
||||
A.on_gain(src)
|
||||
if(A.has_action)
|
||||
A.action.Grant(src)
|
||||
sortInsert(abilities, /proc/cmp_abilities_cost, 0)
|
||||
|
||||
/mob/living/carbon/proc/RemoveAbility(obj/effect/proc_holder/alien/A)
|
||||
abilities.Remove(A)
|
||||
A.on_lose(src)
|
||||
if(A.action)
|
||||
A.action.Remove(src)
|
||||
|
||||
/mob/living/carbon/proc/add_abilities_to_panel()
|
||||
for(var/obj/effect/proc_holder/alien/A in abilities)
|
||||
statpanel("[A.panel]",A.plasma_cost > 0?"([A.plasma_cost])":"",A)
|
||||
|
||||
/mob/living/carbon/Stat()
|
||||
..()
|
||||
if(statpanel("Status"))
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
has_limbs = 1
|
||||
var/obj/item/reagent_containers/food/snacks/meat/slab/type_of_meat = /obj/item/reagent_containers/food/snacks/meat/slab
|
||||
|
||||
var/list/obj/effect/proc_holder/alien/abilities = list()
|
||||
var/gib_type = /obj/effect/decal/cleanable/blood/gibs
|
||||
|
||||
var/rotate_on_lying = 1
|
||||
|
||||
@@ -412,8 +412,9 @@
|
||||
liver_failure()
|
||||
else
|
||||
liver.failing = FALSE
|
||||
|
||||
if(((!(NOLIVER in dna.species.species_traits)) && (!liver)))
|
||||
else
|
||||
if((dna && dna.species && (NOLIVER in dna.species.species_traits)))
|
||||
return
|
||||
liver_failure()
|
||||
|
||||
/mob/living/carbon/proc/undergoing_liver_failure()
|
||||
|
||||
Reference in New Issue
Block a user