diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 0583bb6e072..b968b98c216 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -80,8 +80,7 @@ current = new_character //associate ourself with our new body new_character.mind = src //and associate our new body with ourself transfer_antag_huds(new_character) //inherit the antag HUDs from this mind (TODO: move this to a possible antag datum) - if(spell_list.len > 0) - transfer_mindbound_actions(new_character) + transfer_actions(new_character) if(active) new_character.key = key //now transfer the key to link the client to our new body @@ -1325,6 +1324,11 @@ spell.action.background_icon_state = spell.action_background_icon_state spell.action.Grant(current) return +/datum/mind/proc/transfer_actions(var/mob/living/new_character) + if(current && current.actions) + for(var/datum/action/A in current.actions) + A.Grant(new_character) + transfer_mindbound_actions(new_character) /datum/mind/proc/transfer_mindbound_actions(var/mob/living/new_character) for(var/obj/effect/proc_holder/spell/spell in spell_list) diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 86cd8abf179..e86670e0281 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -154,6 +154,16 @@ /mob/living/carbon/alien/proc/AddAbility(var/obj/effect/proc_holder/alien/A) abilities.Add(A) A.on_gain(src) + if(A.has_action) + if(!A.action) + A.action = new/datum/action/spell_action/alien + A.action.target = A + A.action.name = A.name + A.action.button_icon = A.action_icon + A.action.button_icon_state = A.action_icon_state + A.action.background_icon_state = A.action_background_icon_state + A.action.Grant(src) + /mob/living/carbon/alien/proc/add_abilities_to_panel() for(var/obj/effect/proc_holder/alien/A in abilities) diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm index 43314e72e60..f5fa526654f 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm @@ -4,18 +4,47 @@ These are general powers. Specific powers are stored under the appropriate alien /*Alien spit now works like a taser shot. It won't home in on the target but will act the same once it does hit. Doesn't work on other aliens/AI.*/ + +/datum/action/spell_action/alien + +/datum/action/spell_action/alien/UpdateName() + var/obj/effect/proc_holder/alien/ab = target + return ab.name + +/datum/action/spell_action/alien/IsAvailable() + if(!target) + return 0 + var/obj/effect/proc_holder/alien/ab = target + + if(usr) + return ab.cost_check(ab.check_turf,usr,1) + else + if(owner) + return ab.cost_check(ab.check_turf,owner,1) + return 1 + +/datum/action/spell_action/alien/CheckRemoval() + return !isalien(owner) + + /obj/effect/proc_holder/alien 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.dmi' + var/action_icon_state = "spell_default" + var/action_background_icon_state = "bg_alien" + /obj/effect/proc_holder/alien/Click() if(!istype(usr,/mob/living/carbon/alien)) return 1 var/mob/living/carbon/alien/user = usr if(cost_check(check_turf,user)) - if(fire(user)) + if(fire(user) && user) // Second check to prevent runtimes when evolving user.adjustToxLoss(-plasma_cost) return 1 @@ -25,15 +54,18 @@ Doesn't work on other aliens/AI.*/ /obj/effect/proc_holder/alien/proc/fire(var/mob/living/carbon/alien/user) return 1 -/obj/effect/proc_holder/alien/proc/cost_check(check_turf=0,var/mob/living/carbon/alien/user) +/obj/effect/proc_holder/alien/proc/cost_check(check_turf=0,var/mob/living/carbon/alien/user,var/silent = 0) if(user.stat) - user << "You must be conscious to do this." + if(!silent) + user << "You must be conscious to do this." return 0 if(user.getPlasma() < plasma_cost) - user << "Not enough plasma stored." + if(!silent) + user << "Not enough plasma stored." return 0 if(check_turf && (!isturf(user.loc) || istype(user.loc, /turf/space))) - user << "Bad place for a garden!" + if(!silent) + user << "Bad place for a garden!" return 0 return 1 @@ -43,6 +75,8 @@ Doesn't work on other aliens/AI.*/ plasma_cost = 50 check_turf = 1 + action_icon_state = "alien_plant" + /obj/effect/proc_holder/alien/plant/fire(var/mob/living/carbon/alien/user) if(locate(/obj/structure/alien/weeds/node) in get_turf(user)) src << "There's already a weed node here." @@ -57,6 +91,8 @@ Doesn't work on other aliens/AI.*/ desc = "Whisper to someone" plasma_cost = 10 + action_icon_state = "alien_whisper" + /obj/effect/proc_holder/alien/whisper/fire(var/mob/living/carbon/alien/user) var/mob/M = input("Select who to whisper to:","Whisper to?",null) as mob in oview(user) if(!M) @@ -75,6 +111,8 @@ Doesn't work on other aliens/AI.*/ desc = "Transfer Plasma to another alien" plasma_cost = 0 + action_icon_state = "alien_transfer" + /obj/effect/proc_holder/alien/transfer/fire(var/mob/living/carbon/alien/user) var/list/mob/living/carbon/alien/aliens_around = list() for(var/mob/living/carbon/alien/A in oview(user)) @@ -101,6 +139,8 @@ Doesn't work on other aliens/AI.*/ desc = "Drench an object in acid, destroying it over time." plasma_cost = 200 + action_icon_state = "alien_acid" + /obj/effect/proc_holder/alien/acid/on_gain(var/mob/living/carbon/alien/user) user.verbs.Add(/mob/living/carbon/alien/humanoid/proc/corrosive_acid) @@ -157,6 +197,8 @@ Doesn't work on other aliens/AI.*/ desc = "Spits neurotoxin at someone, paralyzing them for a short time." plasma_cost = 50 + action_icon_state = "alien_neurotoxin" + /obj/effect/proc_holder/alien/neurotoxin/fire(var/mob/living/carbon/alien/user) user.visible_message("[user] spits neurotoxin!", "You spit neurotoxin.") @@ -180,6 +222,8 @@ Doesn't work on other aliens/AI.*/ plasma_cost = 55 check_turf = 1 + action_icon_state = "alien_resin" + /obj/effect/proc_holder/alien/resin/fire(var/mob/living/carbon/alien/user) if(locate(/obj/structure/alien/resin) in user.loc.contents) user << "There is already a resin structure there." @@ -206,6 +250,8 @@ Doesn't work on other aliens/AI.*/ desc = "Empties the contents of your stomach" plasma_cost = 0 + action_icon_state = "alien_barf" + /obj/effect/proc_holder/alien/regurgitate/fire(var/mob/living/carbon/alien/user) if(user.stomach_contents.len) for(var/atom/movable/A in user.stomach_contents) @@ -221,6 +267,8 @@ Doesn't work on other aliens/AI.*/ desc = "Toggles Night Vision" plasma_cost = 0 + has_action = 0 // Has dedicated GUI button already + /obj/effect/proc_holder/alien/nightvisiontoggle/fire(var/mob/living/carbon/alien/user) if(!user.nightvision) diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm index a572cd2d80e..a18f4b2ee00 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/drone.dm @@ -29,6 +29,8 @@ desc = "Produce an interal egg sac capable of spawning children. Only one queen can exist at a time." plasma_cost = 500 + action_icon_state = "alien_evolve_drone" + /obj/effect/proc_holder/alien/evolve/fire(var/mob/living/carbon/alien/user) var/no_queen = 1 for(var/mob/living/carbon/alien/humanoid/queen/Q in living_mob_list) diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 3919492a553..9670240e4aa 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -63,6 +63,8 @@ plasma_cost = 75 check_turf = 1 + action_icon_state = "alien_egg" + /obj/effect/proc_holder/alien/lay_egg/fire(var/mob/living/carbon/alien/user) if(locate(/obj/structure/alien/egg) in get_turf(user)) user << "There's already an egg here." diff --git a/code/modules/mob/living/carbon/alien/larva/powers.dm b/code/modules/mob/living/carbon/alien/larva/powers.dm index 8a4cbfea95a..cf2c73a96c6 100644 --- a/code/modules/mob/living/carbon/alien/larva/powers.dm +++ b/code/modules/mob/living/carbon/alien/larva/powers.dm @@ -3,6 +3,8 @@ desc = "Allows to hide beneath tables or certain items. Toggled on or off." plasma_cost = 0 + action_icon_state = "alien_hide" + /obj/effect/proc_holder/alien/hide/fire(var/mob/living/carbon/alien/user) if(user.stat != CONSCIOUS) return @@ -23,6 +25,8 @@ desc = "Evolve into a fully grown Alien." plasma_cost = 0 + action_icon_state = "alien_evolve_larva" + /obj/effect/proc_holder/alien/larva_evolve/fire(var/mob/living/carbon/alien/user) if(!islarva(user)) return diff --git a/icons/mob/actions.dmi b/icons/mob/actions.dmi index 568fbd295d6..d7034b07271 100644 Binary files a/icons/mob/actions.dmi and b/icons/mob/actions.dmi differ