Merge pull request #2979 from Citadel-Station-13/upstream-merge-30572

[MIRROR] 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:
LetterJay
2017-09-30 02:41:38 -04:00
committed by GitHub
13 changed files with 299 additions and 138 deletions
+17 -13
View File
@@ -485,7 +485,7 @@
/datum/action/spell_action/New(Target)
..()
var/obj/effect/proc_holder/spell/S = target
var/obj/effect/proc_holder/S = target
S.action = src
name = S.name
desc = S.desc
@@ -495,36 +495,40 @@
button.name = name
/datum/action/spell_action/Destroy()
var/obj/effect/proc_holder/spell/S = target
var/obj/effect/proc_holder/S = target
S.action = null
return ..()
/datum/action/spell_action/Trigger()
if(!..())
return 0
return FALSE
if(target)
var/obj/effect/proc_holder/spell = target
spell.Click()
return 1
var/obj/effect/proc_holder/S = target
S.Click()
return TRUE
/datum/action/spell_action/IsAvailable()
if(!target)
return 0
var/obj/effect/proc_holder/spell/spell = target
if(owner)
return spell.can_cast(owner)
return 0
return FALSE
return TRUE
/datum/action/spell_action/spell/IsAvailable()
if(!target)
return FALSE
var/obj/effect/proc_holder/spell/S = target
if(owner)
return S.can_cast(owner)
return FALSE
/datum/action/spell_action/alien
/datum/action/spell_action/alien/IsAvailable()
if(!target)
return 0
return FALSE
var/obj/effect/proc_holder/alien/ab = target
if(owner)
return ab.cost_check(ab.check_turf,owner,1)
return 0
return FALSE