Spell action buttons finally fixed (#33882)

* Action button fix

* Action button fix

* Spell action button fix

* Spell action button fix

* Update alien_powers.dm

* Update spell.dm

* Action button fix

* Update touch_attacks.dm
This commit is contained in:
Robustin
2017-12-29 03:54:31 -05:00
committed by CitadelStationBot
parent 96543b5e63
commit d7723a064c
4 changed files with 11 additions and 4 deletions

View File

@@ -490,6 +490,8 @@
return FALSE
return TRUE
/datum/action/spell_action/spell
/datum/action/spell_action/spell/IsAvailable()
if(!target)
return FALSE

View File

@@ -12,7 +12,7 @@ Doesn't work on other aliens/AI.*/
var/plasma_cost = 0
var/check_turf = FALSE
has_action = TRUE
datum/action/spell_action/alien/action
base_action = /datum/action/spell_action/alien
action_icon = 'icons/mob/actions/actions_xeno.dmi'
action_icon_state = "spell_default"
action_background_icon_state = "bg_alien"

View File

@@ -13,11 +13,12 @@
var/action_icon = 'icons/mob/actions/actions_spells.dmi'
var/action_icon_state = "spell_default"
var/action_background_icon_state = "bg_spell"
var/base_action = /datum/action/spell_action
/obj/effect/proc_holder/Initialize()
. = ..()
if(has_action)
action = new(src)
action = new base_action(src)
/obj/effect/proc_holder/proc/on_gain(mob/living/user)
return
@@ -103,6 +104,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
pass_flags = PASSTABLE
density = FALSE
opacity = 0
base_action = /datum/action/spell_action/spell
var/school = "evocation" //not relevant at now, but may be important later if there are changes to how spells work. the ones I used for now will probably be changed... maybe spell presets? lacking flexibility but with some other benefit?
@@ -149,7 +151,6 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
action_icon = 'icons/mob/actions/actions_spells.dmi'
action_icon_state = "spell_default"
action_background_icon_state = "bg_spell"
datum/action/spell_action/spell/action
/obj/effect/proc_holder/spell/proc/cast_check(skipcharge = 0,mob/user = usr) //checks if the spell can be cast based on its settings; skipcharge is used when an additional cast_check is called inside the spell
@@ -255,7 +256,6 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
/obj/effect/proc_holder/spell/Initialize()
. = ..()
action = new(src)
START_PROCESSING(SSfastprocess, src)
still_recharging_msg = "<span class='notice'>[name] is still recharging.</span>"

View File

@@ -23,6 +23,11 @@
charge_counter = 0
stoplag(1)
/obj/effect/proc_holder/spell/targeted/touch/can_cast(mob/user = usr)
if(attached_hand)
return TRUE
return ..()
/obj/effect/proc_holder/spell/targeted/touch/proc/ChargeHand(mob/living/carbon/user)
attached_hand = new hand_path(src)
if(!user.put_in_hands(attached_hand))