diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 0ad2701cd1e..35b75629a3b 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -143,7 +143,6 @@ martial_art.remove(current) else martial_art.teach(current) - if(active) new_character.key = key //now transfer the key to link the client to our new body SEND_SIGNAL(src, COMSIG_MIND_TRANSER_TO, new_character) diff --git a/code/datums/spell_handler/alien_spell_handler.dm b/code/datums/spell_handler/alien_spell_handler.dm new file mode 100644 index 00000000000..2402653e102 --- /dev/null +++ b/code/datums/spell_handler/alien_spell_handler.dm @@ -0,0 +1,37 @@ +/* This is the handler for alien spells +This relies on a lot of different procs on the spell and carbon level, so if you are editing this, remember to check that the other procs aren't editied in a way that +could change behavior. +You're gonna see a lot of plasmavessel checks and alien checks, as a lot of things need to work a certain way when used by an alien, and a different way when used by a human. +This was also the case with the verb implementation, it's just much more obvious now. + */ +/datum/spell_handler/alien + /// Amount of plasma required to use this ability + var/plasma_cost = 0 + +/datum/spell_handler/alien/can_cast(mob/living/carbon/user, charge_check, show_message, obj/effect/proc_holder/spell/spell) + var/obj/item/organ/internal/alien/plasmavessel/vessel = user.get_int_organ(/obj/item/organ/internal/alien/plasmavessel) + if(!vessel) + return 0 + if(vessel.stored_plasma < plasma_cost) + if(show_message) + to_chat(user, "You require at least [plasma_cost] plasma to use this ability!") + return FALSE + return TRUE + +/datum/spell_handler/alien/spend_spell_cost(mob/living/carbon/user, obj/effect/proc_holder/spell/spell) + user.use_plasma_spell(plasma_cost, user) + +/datum/spell_handler/alien/before_cast(list/targets, mob/living/carbon/user, obj/effect/proc_holder/spell/spell) + to_chat(user, "You have [user.get_plasma()] plasma left to use.") + user.update_plasma_display(user) + +/datum/spell_handler/alien/revert_cast(mob/living/carbon/user, obj/effect/proc_holder/spell/spell) + user.add_plasma(plasma_cost, user) + to_chat(user, "You have [user.get_plasma()] plasma left to use.") + user.update_plasma_display(user) + +/mob/living/carbon/proc/get_plasma() + var/obj/item/organ/internal/alien/plasmavessel/vessel = get_int_organ(/obj/item/organ/internal/alien/plasmavessel) + if(!vessel) + return 0 + return vessel.stored_plasma diff --git a/code/datums/spells/alien_spells/basetype_alien_spell.dm b/code/datums/spells/alien_spells/basetype_alien_spell.dm new file mode 100644 index 00000000000..a5b3dcfdea7 --- /dev/null +++ b/code/datums/spells/alien_spells/basetype_alien_spell.dm @@ -0,0 +1,45 @@ +/mob/living/carbon/proc/use_plasma_spell(amount, mob/living/carbon/user) + var/obj/item/organ/internal/alien/plasmavessel/vessel = get_int_organ(/obj/item/organ/internal/alien/plasmavessel) + if(amount > vessel.stored_plasma) + return FALSE + add_plasma(-amount) + return TRUE + +/* add_plasma just requires the plasma amount, so admins can easily varedit it and stuff +Updates the spell's actions on use as well, so they know when they can or can't use their powers*/ + +/mob/living/carbon/proc/add_plasma(amount) + var/obj/item/organ/internal/alien/plasmavessel/vessel = get_int_organ(/obj/item/organ/internal/alien/plasmavessel) + if(!vessel) + return + vessel.stored_plasma += amount + if(vessel.stored_plasma > vessel.max_plasma) + vessel.stored_plasma = vessel.max_plasma + update_plasma_display(src) + for(var/datum/action/spell_action/action in actions) + action.UpdateButtonIcon() + +/obj/effect/proc_holder/spell/alien_spell + action_background_icon_state = "bg_alien" + clothes_req = FALSE + /// Extremely fast cooldown, only present so the cooldown system doesn't explode + base_cooldown = 1 + create_attack_logs = FALSE + /// Every alien spell creates only logs, no attack messages on someone placing weeds, but you DO get attack messages on neurotoxin and corrosive acid + create_custom_logs = TRUE + /// How much plasma it costs to use this + var/plasma_cost = 0 + +/// Every single alien spell uses a "spell name + plasmacost" format +/obj/effect/proc_holder/spell/alien_spell/Initialize(mapload) + . = ..() + if(plasma_cost) + name = "[name] ([plasma_cost])" + +/obj/effect/proc_holder/spell/alien_spell/write_custom_logs(list/targets, mob/user) + user.create_log(ATTACK_LOG, "Cast the spell [name]") + +/obj/effect/proc_holder/spell/alien_spell/create_new_handler() + var/datum/spell_handler/alien/handler = new + handler.plasma_cost = plasma_cost + return handler diff --git a/code/datums/spells/alien_spells/basetype_alien_touch.dm b/code/datums/spells/alien_spells/basetype_alien_touch.dm new file mode 100644 index 00000000000..af15f280143 --- /dev/null +++ b/code/datums/spells/alien_spells/basetype_alien_touch.dm @@ -0,0 +1,53 @@ +/obj/effect/proc_holder/spell/touch/alien_spell + name = "Basetype Alien spell" + desc = "You should not see this in game, if you do file a github report!" + hand_path = "/obj/item/melee/touch_attack/alien" + /// Extremely fast cooldown, only present so the cooldown system doesn't explode + base_cooldown = 1 + action_background_icon_state = "bg_alien" + clothes_req = FALSE + create_attack_logs = FALSE + /// Every alien spell creates only logs, no attack messages on someone placing weeds, but you DO get attack messages on neurotoxin and corrosive acid + create_custom_logs = TRUE + /// We want a special on remove message, so we got this variable to do so + on_remove_message = FALSE + /// How much plasma it costs to use this + var/plasma_cost = 0 + action_icon_state = "gib" + +/obj/effect/proc_holder/spell/touch/alien_spell/Initialize(mapload) + . = ..() + if(plasma_cost) + name = "[name] ([plasma_cost])" + +/obj/effect/proc_holder/spell/touch/alien_spell/Click(mob/user = usr) + if(attached_hand) + to_chat(user, "You withdraw your [src].") + ..() + +/obj/effect/proc_holder/spell/touch/alien_spell/cast(list/targets, mob/living/carbon/user) + user.add_plasma(plasma_cost) + ..() + +/obj/effect/proc_holder/spell/touch/alien_spell/write_custom_logs(list/targets, mob/user) + user.create_log(ATTACK_LOG, "Cast the spell [name]") + +/obj/effect/proc_holder/spell/touch/alien_spell/create_new_handler() + var/datum/spell_handler/alien/H = new + H.plasma_cost = plasma_cost + return H + +/obj/item/melee/touch_attack/alien + name = "Basetype Alien touch_attack" + desc = "You should not see this in game, if you do file a github report!" + /// Alien spells don't have catchphrases + catchphrase = null + /// Beepsky shouldn't be arresting you over this + needs_permit = FALSE + +/obj/item/melee/touch_attack/alien/proc/plasma_check(plasma, mob/living/carbon/user) + var/plasma_current = user.get_plasma() + if(plasma_current < plasma) + qdel(src) + return FALSE + return TRUE diff --git a/code/datums/spells/alien_spells/build_resin_structure.dm b/code/datums/spells/alien_spells/build_resin_structure.dm new file mode 100644 index 00000000000..aadbcabcdea --- /dev/null +++ b/code/datums/spells/alien_spells/build_resin_structure.dm @@ -0,0 +1,41 @@ +/obj/effect/proc_holder/spell/alien_spell/build_resin + name = "Build Resin Structure" + desc = "Allows you to create resin structures. Does not work while in space." + plasma_cost = 55 + action_icon_state = "alien_resin" + +/obj/effect/proc_holder/spell/alien_spell/build_resin/create_new_targeting() + return new /datum/spell_targeting/self + +/obj/effect/proc_holder/spell/alien_spell/build_resin/cast(list/targets, mob/living/carbon/user) + var/static/list/resin_buildings = list("Resin Wall (55)" = image(icon = 'icons/obj/smooth_structures/alien/resin_wall.dmi', icon_state = "resin_wall-0"), + "Resin Nest (55)" = image(icon = 'icons/mob/alien.dmi', icon_state = "nest"), + "Resin door (80)" = image(icon = 'icons/obj/smooth_structures/alien/resin_door.dmi', icon_state = "resin")) + var/choice = show_radial_menu(user, user, resin_buildings, src, radius = 40) + var/turf/turf_to_spawn_at = user.loc + if(!choice) + revert_cast(user) + return + if(isspaceturf(turf_to_spawn_at)) + to_chat(user, "You cannot build the [choice] while in space!") + revert_cast(user) + return + var/obj/structure/alien/resin/resin_on_turf = locate() in turf_to_spawn_at + if(resin_on_turf) + to_chat(user, "There is already a resin construction here.") + revert_cast(user) + return + visible_message("[user] vomits up a thick purple substance and shapes it!") + switch(choice) + if("Resin Wall (55)") + new /obj/structure/alien/resin/wall(turf_to_spawn_at) + if("Resin Nest (55)") + new /obj/structure/bed/nest(turf_to_spawn_at) + if("Resin door (80)") + var/plasma_current = user.get_plasma() + if(plasma_current >= 25) + new /obj/structure/alien/resin/door(turf_to_spawn_at) + user.add_plasma(-25) + return + to_chat(user, "You don't have enough plasma to place a door down.") + revert_cast(user) diff --git a/code/datums/spells/alien_spells/corrosive_acid_spit.dm b/code/datums/spells/alien_spells/corrosive_acid_spit.dm new file mode 100644 index 00000000000..c8e63943814 --- /dev/null +++ b/code/datums/spells/alien_spells/corrosive_acid_spit.dm @@ -0,0 +1,29 @@ +/obj/effect/proc_holder/spell/touch/alien_spell/corrosive_acid + name = "Corrosive acid" + desc = "Spit acid on someone in range, this acid melts through nearly anything and heavily damages anyone lacking proper safety equipment." + hand_path = "/obj/item/melee/touch_attack/alien/corrosive_acid" + action_icon_state = "alien_acid" + plasma_cost = 200 + +/obj/item/melee/touch_attack/alien/corrosive_acid + name = "Corrosive acid" + desc = "A fistfull of death." + icon_state = "alien_acid" + +/obj/item/melee/touch_attack/alien/corrosive_acid/afterattack(atom/target, mob/living/carbon/user, proximity) + if(target == user) + to_chat(user, "You withdraw your readied acid.") + ..() + return + if(!proximity || isalien(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) // Don't want xenos ditching out of cuffs + return + if(!plasma_check(200, user)) + to_chat(user, "You don't have enough plasma to perform this action!") + return + if(target.acid_act(200, 100)) + visible_message("[user] vomits globs of vile stuff all over [target]. It begins to sizzle and melt under the bubbling mess of acid!") + add_attack_logs(user, target, "Applied corrosive acid") // Want this logged + user.add_plasma(-200) + else + to_chat(user, "You cannot dissolve this object.") + ..() diff --git a/code/datums/spells/alien_spells/larva_evolve.dm b/code/datums/spells/alien_spells/larva_evolve.dm new file mode 100644 index 00000000000..c662d21c1d0 --- /dev/null +++ b/code/datums/spells/alien_spells/larva_evolve.dm @@ -0,0 +1,45 @@ +// Make this reflect amount grown, can't do that currently +/obj/effect/proc_holder/spell/alien_spell/evolve_larva + name = "Evolve." + desc = "Evolve into a fully grown Alien." + action_icon_state = "alien_evolve_larva" + +/obj/effect/proc_holder/spell/alien_spell/evolve_larva/create_new_targeting() + return new /datum/spell_targeting/self + +/obj/effect/proc_holder/spell/alien_spell/evolve_larva/cast(list/targets, mob/living/carbon/alien/larva/user) + if(user.stat != CONSCIOUS) + return + + if(user.handcuffed || user.legcuffed) + to_chat(user, "You cannot evolve when you are cuffed.") + return + + if(user.amount_grown < user.max_grown) + to_chat(user, "You are not fully grown.") + return + //green is impossible to read, so i made these blue and changed the formatting slightly + to_chat(user, "You are growing into a beautiful alien! It is time to choose a caste.") + to_chat(user, "There are three to choose from:") + to_chat(user, "Hunters are strong and agile, able to hunt away from the hive and rapidly move through ventilation shafts. Hunters generate plasma slowly and have low reserves.") + to_chat(user, "Sentinels are tasked with protecting the hive and are deadly up close and at a range. They are not as physically imposing nor fast as the hunters.") + to_chat(user, "Drones are the working class, offering the largest plasma storage and generation. They are the only caste which may evolve again, turning into the dreaded alien queen.") + var/static/list/to_evolve = list("Hunter" = image(icon = 'icons/mob/alien.dmi', icon_state = "alienh_s"), + "Sentinel" = image(icon = 'icons/mob/alien.dmi', icon_state = "aliend_s"), + "Drone" = image(icon = 'icons/mob/alien.dmi', icon_state = "aliend_s")) + var/new_xeno = show_radial_menu(user, user, to_evolve, src, radius = 40) + var/turf/T = user.loc + if(!new_xeno) + return + var/to_spawn + switch(new_xeno) + if("Hunter") + to_spawn = new /mob/living/carbon/alien/humanoid/hunter(T) + if("Sentinel") + to_spawn = new /mob/living/carbon/alien/humanoid/sentinel(T) + if("Drone") + to_spawn = new /mob/living/carbon/alien/humanoid/drone(T) + if(user.mind) + user.mind.transfer_to(to_spawn) + SSblackbox.record_feedback("tally", "alien_growth", 1, "[lowertext(new_xeno)]") + qdel(user) diff --git a/code/datums/spells/alien_spells/lay_alien_eggs.dm b/code/datums/spells/alien_spells/lay_alien_eggs.dm new file mode 100644 index 00000000000..7789420e1c3 --- /dev/null +++ b/code/datums/spells/alien_spells/lay_alien_eggs.dm @@ -0,0 +1,7 @@ +/obj/effect/proc_holder/spell/alien_spell/plant_weeds/eggs + name = "Plant alien eggs" + desc = "Allows you to plant alien eggs on your current turf, does not work while in space." + plasma_cost = 75 + weed_type = /obj/structure/alien/egg + weed_name = "alien egg" + action_icon_state = "alien_egg" diff --git a/code/datums/spells/alien_spells/neurotoxin_spit.dm b/code/datums/spells/alien_spells/neurotoxin_spit.dm new file mode 100644 index 00000000000..ca688886d13 --- /dev/null +++ b/code/datums/spells/alien_spells/neurotoxin_spit.dm @@ -0,0 +1,36 @@ +/obj/effect/proc_holder/spell/alien_spell/neurotoxin + name = "Neurotoxin spit" + desc = "This ability allows you to fire some neurotoxin. Knocks down anyone you hit, applies a small amount of stamina damage as well." + base_cooldown = 5 SECONDS + plasma_cost = 50 + selection_activated_message = "Your prepare some neurotoxin!" + selection_deactivated_message = "You swallow your prepared neurotoxin." + var/neurotoxin_type = /obj/item/projectile/bullet/neurotoxin + action_icon_state = "alien_neurotoxin_0" + active = FALSE + +/obj/effect/proc_holder/spell/alien_spell/neurotoxin/create_new_targeting() + return new /datum/spell_targeting/clicked_atom + +/obj/effect/proc_holder/spell/alien_spell/neurotoxin/update_icon_state() + if(!action) + return + action.button_icon_state = "alien_neurotoxin_[active]" + action.UpdateButtonIcon() + +/obj/effect/proc_holder/spell/alien_spell/neurotoxin/cast(list/targets, mob/living/carbon/user) + var/target = targets[1] + var/turf/T = user.loc + var/turf/U = get_step(user, user.dir) // A little aimbot is fine + if(!istype(U) || !istype(T)) + return FALSE + + var/obj/item/projectile/bullet/neurotoxin/neurotoxin = new neurotoxin_type(user.loc) + neurotoxin.current = get_turf(user) + neurotoxin.original = target + neurotoxin.firer = user + neurotoxin.preparePixelProjectile(target, get_turf(target), user) + neurotoxin.fire() + user.newtonian_move(get_dir(U, T)) + + return TRUE diff --git a/code/datums/spells/alien_spells/plasma_weeds.dm b/code/datums/spells/alien_spells/plasma_weeds.dm new file mode 100644 index 00000000000..1cd4f27714a --- /dev/null +++ b/code/datums/spells/alien_spells/plasma_weeds.dm @@ -0,0 +1,25 @@ +/obj/effect/proc_holder/spell/alien_spell/plant_weeds + name = "Plant weeds" + desc = "Allows you to plant some alien weeds on the floor below you. Does not work while in space." + plasma_cost = 50 + var/weed_type = /obj/structure/alien/weeds/node + var/weed_name = "alien weed node" + action_icon_state = "alien_plant" + +/obj/effect/proc_holder/spell/alien_spell/plant_weeds/create_new_targeting() + return new /datum/spell_targeting/self + +/obj/effect/proc_holder/spell/alien_spell/plant_weeds/cast(list/targets, mob/living/carbon/user) + var/turf/T = user.loc + if(locate(weed_type) in T) + to_chat(user, "There's already an [weed_name] here.") + revert_cast() + return + + if(isspaceturf(T)) + to_chat(user, "You cannot plant [weed_name]s in space.") + revert_cast() + return + + user.visible_message("[user] has planted a [weed_name]!") + new weed_type(T) diff --git a/code/datums/spells/alien_spells/queen_evolve.dm b/code/datums/spells/alien_spells/queen_evolve.dm new file mode 100644 index 00000000000..e8112f0506c --- /dev/null +++ b/code/datums/spells/alien_spells/queen_evolve.dm @@ -0,0 +1,25 @@ +/obj/effect/proc_holder/spell/alien_spell/evolve_queen + name = "Evolve into an alien queen" + desc = "Evolve into an alien queen." + plasma_cost = 500 + action_icon_state = "alien_evolve_drone" + +/obj/effect/proc_holder/spell/alien_spell/evolve_queen/create_new_targeting() + return new /datum/spell_targeting/self + +/obj/effect/proc_holder/spell/alien_spell/evolve_queen/cast(list/targets, mob/living/carbon/user) + /// First we check if there is a living queen + for(var/mob/living/carbon/alien/humanoid/queen/living_queen in GLOB.alive_mob_list) + if(living_queen.key || !living_queen.get_int_organ(/obj/item/organ/internal/brain)) // We do a once over to check the queen didn't end up going away into the magic land of semi-dead + to_chat(user, "We already have an alive queen.") + revert_cast(user) + return + // If there is no queen, that means we can evolve + to_chat(user, "You begin to evolve!") + user.visible_message("[user] begins to twist and contort!") + var/turf/userloc = user.loc + var/mob/living/carbon/alien/humanoid/queen/new_xeno = new(userloc) + user.mind.transfer_to(new_xeno) + new_xeno.mind.name = new_xeno.name + SSblackbox.record_feedback("tally", "alien_growth", 1, "queen") + qdel(user) diff --git a/code/datums/spells/alien_spells/regurgitate.dm b/code/datums/spells/alien_spells/regurgitate.dm new file mode 100644 index 00000000000..effd0a9629b --- /dev/null +++ b/code/datums/spells/alien_spells/regurgitate.dm @@ -0,0 +1,15 @@ +/obj/effect/proc_holder/spell/alien_spell/regurgitate + name = "Regurgitate" + desc = "Empties the contents of your stomach onto the ground." + action_icon_state = "alien_barf" + +/obj/effect/proc_holder/spell/alien_spell/regurgitate/create_new_targeting() + return new /datum/spell_targeting/self + +/obj/effect/proc_holder/spell/alien_spell/regurgitate/cast(list/targets, mob/living/carbon/user) + for(var/mob/M in user.stomach_contents) + var/turf/output_loc = user.loc + M.forceMove(output_loc) + visible_message("[user] hurls out the contents of [p_their()] stomach!") + return + visible_message("[user] dry heaves!") diff --git a/code/datums/spells/alien_spells/transfer_plasma.dm b/code/datums/spells/alien_spells/transfer_plasma.dm new file mode 100644 index 00000000000..1edf34dfa67 --- /dev/null +++ b/code/datums/spells/alien_spells/transfer_plasma.dm @@ -0,0 +1,28 @@ +/obj/effect/proc_holder/spell/touch/alien_spell/transfer_plasma + name = "Transfer Plasma" + desc = "Transfers 50 plasma to a nearby alien" + hand_path = "/obj/item/melee/touch_attack/alien/transfer_plasma" + action_icon_state = "alien_transfer" + plasma_cost = 50 + +/obj/item/melee/touch_attack/alien/transfer_plasma + name = "plasma transfer" + desc = "Transfers 50 plasma to another alien." + icon_state = "alien_transfer" + +/obj/item/melee/touch_attack/alien/transfer_plasma/afterattack(atom/target, mob/living/carbon/user, proximity) + if(target == user) + to_chat(user, "You withdraw your readied plasma.") + ..() + return + if(!proximity || !isalien(target) || !iscarbon(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED)) + return + if(!plasma_check(50, user)) + to_chat(user, "You don't have enough plasma to perform this action!") + return + user.add_plasma(-50) + var/mob/living/carbon/transfering_to = target + transfering_to.add_plasma(50) + to_chat(user, "You have transfered 50 plasma to [transfering_to].") + to_chat(transfering_to, "[user] has transfered 50 plasma to you!") + ..() diff --git a/code/datums/spells/alien_spells/whisper.dm b/code/datums/spells/alien_spells/whisper.dm new file mode 100644 index 00000000000..22febebc1f9 --- /dev/null +++ b/code/datums/spells/alien_spells/whisper.dm @@ -0,0 +1,28 @@ +/obj/effect/proc_holder/spell/alien_spell/whisper + name = "Whisper" + desc = "Whisper into a target's mind." + plasma_cost = 10 + action_icon_state = "alien_whisper" + var/target + +/obj/effect/proc_holder/spell/alien_spell/whisper/create_new_targeting() // Yeah this is copy and pasted code from cryoken and it's good enough + var/datum/spell_targeting/click/T = new() + T.allowed_type = /mob/living + T.click_radius = 0 + T.try_auto_target = FALSE + T.selection_type = SPELL_SELECTION_RANGE + T.include_user = TRUE + return T + +/obj/effect/proc_holder/spell/alien_spell/whisper/cast(list/targets, mob/living/carbon/user) + var/mob/living/target = targets[1] + + var/msg = sanitize(input("Message:", "Alien Whisper") as text|null) + if(!msg) + revert_cast(user) + return + log_say("(AWHISPER to [key_name(target)]) [msg]", user) + to_chat(target, "You hear a strange, alien voice in your head... [msg]") + to_chat(user, "You said: [msg] to [target]") + for(var/mob/dead/observer/ghosts in GLOB.player_list) + ghosts.show_message("Alien message from [user] ([ghost_follow_link(user, ghost=ghosts)]) to [target] ([ghost_follow_link(target, ghost=ghosts)]): [msg]") diff --git a/code/datums/spells/touch_attacks.dm b/code/datums/spells/touch_attacks.dm index d405e921f2b..3611c0c1353 100644 --- a/code/datums/spells/touch_attacks.dm +++ b/code/datums/spells/touch_attacks.dm @@ -1,6 +1,7 @@ /obj/effect/proc_holder/spell/touch var/hand_path = /obj/item/melee/touch_attack var/obj/item/melee/touch_attack/attached_hand = null + var/on_remove_message = TRUE invocation_type = "none" //you scream on connecting, not summoning /obj/effect/proc_holder/spell/touch/create_new_targeting() @@ -11,15 +12,16 @@ qdel(attached_hand) cooldown_handler.revert_cast() attached_hand = null - to_chat(user, "You draw the power out of your hand.") - return 0 + if(on_remove_message) + to_chat(user, "You draw the power out of your hand.") + return FALSE ..() /obj/effect/proc_holder/spell/touch/cast(list/targets, mob/user = usr) for(var/mob/living/carbon/target in targets) if(!attached_hand) if(!ChargeHand(target)) - return 0 + return FALSE while(attached_hand) //hibernate untill the spell is actually used cooldown_handler.recharge_time++ // adds a tick onto the cooldown each tick sleep(1) @@ -27,6 +29,9 @@ /obj/effect/proc_holder/spell/touch/proc/ChargeHand(mob/living/carbon/user) var/hand_handled = 1 attached_hand = new hand_path(src) + if(isalien(user)) + user.put_in_hands(attached_hand) + return if(user.hand) //left active hand if(!user.equip_to_slot_if_possible(attached_hand, slot_l_hand, FALSE, TRUE)) if(!user.equip_to_slot_if_possible(attached_hand, slot_r_hand, FALSE, TRUE)) diff --git a/code/game/gamemodes/wizard/godhand.dm b/code/game/gamemodes/wizard/godhand.dm index 162bf060cff..42eafd0fd3a 100644 --- a/code/game/gamemodes/wizard/godhand.dm +++ b/code/game/gamemodes/wizard/godhand.dm @@ -26,7 +26,8 @@ ..() /obj/item/melee/touch_attack/afterattack(atom/target, mob/user, proximity) - user.say(catchphrase) + if(catchphrase) + user.say(catchphrase) playsound(get_turf(user), on_use_sound,50,1) attached_spell.attached_hand = null qdel(src) diff --git a/code/game/objects/effects/meteors.dm b/code/game/objects/effects/meteors.dm index b3be316f211..7316759456b 100644 --- a/code/game/objects/effects/meteors.dm +++ b/code/game/objects/effects/meteors.dm @@ -311,7 +311,7 @@ GLOBAL_LIST_INIT(meteors_ops, list(/obj/effect/meteor/goreops)) //Meaty Ops meteorgibs = /obj/effect/gibspawner/xeno /obj/effect/meteor/meaty/xeno/Initialize(mapload, target) - meteordrop += subtypesof(/obj/item/organ/internal/xenos) + meteordrop += subtypesof(/obj/item/organ/internal/alien) return ..() /obj/effect/meteor/meaty/xeno/ram_turf(turf/T) diff --git a/code/game/objects/structures/aliens.dm b/code/game/objects/structures/aliens.dm index ecae702cf17..450f196ea48 100644 --- a/code/game/objects/structures/aliens.dm +++ b/code/game/objects/structures/aliens.dm @@ -164,7 +164,7 @@ if(!iscarbon(user)) return var/mob/living/carbon/C = user - if(C.get_int_organ(/obj/item/organ/internal/xenos/hivenode)) + if(C.get_int_organ(/obj/item/organ/internal/alien/hivenode)) if(world.time - C.last_bumped <= 60) return if(!C.handcuffed) @@ -492,7 +492,7 @@ return attack_hand(user) /obj/structure/alien/egg/attack_hand(mob/living/user) - if(user.get_int_organ(/obj/item/organ/internal/xenos/hivenode)) + if(user.get_int_organ(/obj/item/organ/internal/alien/plasmavessel)) switch(status) if(BURST) to_chat(user, "You clear the hatched egg.") diff --git a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm index cc4ac4e012f..49d4946ba68 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm @@ -19,7 +19,7 @@ for(var/buck in buckled_mobs) //breaking a nest releases all the buckled mobs, because the nest isn't holding them down anymore var/mob/living/M = buck - if(user.get_int_organ(/obj/item/organ/internal/xenos/hivenode)) + if(user.get_int_organ(/obj/item/organ/internal/alien/plasmavessel)) unbuckle_mob(M) add_fingerprint(user) return @@ -49,11 +49,11 @@ if (!ismob(M) || (get_dist(src, user) > 1) || (M.loc != loc) || user.incapacitated() || M.buckled) return - if(M.get_int_organ(/obj/item/organ/internal/xenos/hivenode)) + if(M.get_int_organ(/obj/item/organ/internal/alien/hivenode)) to_chat(user, "[M]'s linkage with the hive prevents you from securing them into [src]") return - if(!user.get_int_organ(/obj/item/organ/internal/xenos/hivenode)) + if(!user.get_int_organ(/obj/item/organ/internal/alien/hivenode)) to_chat(user, "Your lack of linkage to the hive prevents you from buckling [M] into [src]") return diff --git a/code/modules/mob/living/carbon/alien/alien_base.dm b/code/modules/mob/living/carbon/alien/alien_base.dm index 18e23507a8e..b6827767770 100644 --- a/code/modules/mob/living/carbon/alien/alien_base.dm +++ b/code/modules/mob/living/carbon/alien/alien_base.dm @@ -40,7 +40,7 @@ RETURN_TYPE(/list/obj/item/organ/internal) return list( /obj/item/organ/internal/brain/xeno, - /obj/item/organ/internal/xenos/hivenode, + /obj/item/organ/internal/alien/hivenode, /obj/item/organ/internal/ears ) @@ -220,14 +220,19 @@ Des: Removes all infected images from the alien. return /mob/living/carbon/alien/canBeHandcuffed() - return 1 + return TRUE -/mob/living/carbon/alien/proc/updatePlasmaDisplay() - if(hud_used) //clientless aliens - hud_used.alien_plasma_display.maptext = "
[getPlasma()]
" - hud_used.alien_plasma_display.maptext_x = -3 +/* Although this is on the carbon level, we only want this proc'ing for aliens that do have this hud. Only humanoid aliens do at the moment, so we have a check +and carry the owner just to make sure*/ +/mob/living/carbon/proc/update_plasma_display(mob/owner) + for(var/datum/action/spell_action/action in actions) + action.UpdateButtonIcon() + if(!hud_used || !isalien(owner)) //clientless aliens or non aliens + return + hud_used.alien_plasma_display.maptext = "
[get_plasma()]
" + hud_used.alien_plasma_display.maptext_x = -3 -/mob/living/carbon/alien/larva/updatePlasmaDisplay() +/mob/living/carbon/alien/larva/update_plasma_display() return /mob/living/carbon/alien/can_use_vents() diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm index 761cfe1a8d3..5b45fd6181b 100644 --- a/code/modules/mob/living/carbon/alien/alien_defense.dm +++ b/code/modules/mob/living/carbon/alien/alien_defense.dm @@ -3,13 +3,13 @@ /*Code for aliens attacking aliens. Because aliens act on a hivemind, I don't see them as very aggressive with each other. As such, they can either help or harm other aliens. Help works like the human help command while harm is a simple nibble. -In all, this is a lot like the monkey code. /N +In all, this is a lot like the monkey code. +This code could certainly use with a touch of TLC, but it functions alright. Bit odd aliens attacking other aliens are like, full logged though */ /mob/living/carbon/alien/attack_alien(mob/living/carbon/alien/M) if(isturf(loc) && istype(loc.loc, /area/start)) to_chat(M, "No attacking people at spawn, you jackass.") return - switch(M.a_intent) if(INTENT_HELP) AdjustSleeping(-10 SECONDS) @@ -39,7 +39,7 @@ In all, this is a lot like the monkey code. /N /mob/living/carbon/alien/attack_hand(mob/living/carbon/human/M) if(..()) //to allow surgery to return properly. - return 0 + return FALSE switch(M.a_intent) if(INTENT_HELP) @@ -53,8 +53,8 @@ In all, this is a lot like the monkey code. /N M.do_attack_animation(src, ATTACK_EFFECT_PUNCH) if(INTENT_DISARM) M.do_attack_animation(src, ATTACK_EFFECT_DISARM) - return 1 - return 0 + return TRUE + return FALSE /mob/living/carbon/alien/attack_animal(mob/living/simple_animal/M) . = ..() @@ -75,9 +75,9 @@ In all, this is a lot like the monkey code. /N adjustStaminaLoss(damage) /mob/living/carbon/alien/acid_act(acidpwr, acid_volume) - return 0 //aliens are immune to acid. + return FALSE //aliens are immune to acid. -/mob/living/carbon/alien/attack_slime(mob/living/simple_animal/slime/M) +/mob/living/carbon/alien/attack_slime(mob/living/simple_animal/slime/M) // This is very RNG based, maybe come back to this later - GDN if(..()) //successful slime attack var/damage = rand(5, 35) if(M.is_adult) diff --git a/code/modules/mob/living/carbon/alien/alien_life.dm b/code/modules/mob/living/carbon/alien/alien_life.dm index 02da43d9736..4c25a4eadc8 100644 --- a/code/modules/mob/living/carbon/alien/alien_life.dm +++ b/code/modules/mob/living/carbon/alien/alien_life.dm @@ -14,7 +14,7 @@ var/Toxins_pp = (breath.toxins / breath.total_moles()) * breath_pressure if(Toxins_pp > tox_detect_threshold) // Detect toxins in air - adjustPlasma(breath.toxins*250) + add_plasma(breath.toxins * 250) throw_alert("alien_tox", /obj/screen/alert/alien_tox) toxins_used = breath.toxins diff --git a/code/modules/mob/living/carbon/alien/alien_login.dm b/code/modules/mob/living/carbon/alien/alien_login.dm index 5c177fbb622..589a9741627 100644 --- a/code/modules/mob/living/carbon/alien/alien_login.dm +++ b/code/modules/mob/living/carbon/alien/alien_login.dm @@ -1,4 +1,5 @@ /mob/living/carbon/alien/Login() ..() AddInfectionImages() + update_plasma_display(src) return diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm deleted file mode 100644 index 1593bab6d4d..00000000000 --- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm +++ /dev/null @@ -1,191 +0,0 @@ -/*NOTES: -These are general powers. Specific powers are stored under the appropriate alien creature type. -*/ - -/*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.*/ - - -/mob/living/carbon/proc/powerc(X, Y)//Y is optional, checks for weed planting. X can be null. - if(stat) - to_chat(src, "You must be conscious to do this.") - return 0 - else if(X && getPlasma() < X) - to_chat(src, "Not enough plasma stored.") - return 0 - else if(Y && (!isturf(src.loc) || isspaceturf(src.loc))) - to_chat(src, "You can't place that here!") - return 0 - else return 1 - -/mob/living/carbon/alien/humanoid/verb/plant() - set name = "Plant Weeds (50)" - set desc = "Plants some alien weeds" - set category = "Alien" - - if(locate(/obj/structure/alien/weeds/node) in get_turf(src)) - to_chat(src, "There's already a weed node here.") - return - - if(powerc(50,1)) - for(var/obj/structure/alien/resin in get_turf(src)) - to_chat(src, "There is already a resin construction here.") - return - adjustPlasma(-50) - for(var/mob/O in viewers(src, null)) - O.show_message(text("[src] has planted some alien weeds!"), 1) - for(var/obj/structure/alien/weeds/W in get_turf(src)) - qdel(W) - new /obj/structure/alien/weeds/node(loc) - return - -/mob/living/carbon/alien/humanoid/verb/whisp(mob/M as mob in oview()) - set name = "Whisper (10)" - set desc = "Whisper to someone" - set category = "Alien" - - if(powerc(10)) - adjustPlasma(-10) - var/msg = sanitize(input("Message:", "Alien Whisper") as text|null) - if(msg) - log_say("(AWHISPER to [key_name(M)]) [msg]", src) - to_chat(M, "You hear a strange, alien voice in your head...[msg]") - to_chat(src, "You said: [msg] to [M]") - for(var/mob/dead/observer/G in GLOB.player_list) - G.show_message("Alien message from [src] ([ghost_follow_link(src, ghost=G)]) to [M] ([ghost_follow_link(M, ghost=G)]): [msg]") - return - -/mob/living/carbon/alien/humanoid/verb/transfer_plasma(mob/living/carbon/alien/M as mob in oview()) - set name = "Transfer Plasma" - set desc = "Transfer Plasma to another alien" - set category = "Alien" - - if(isalien(M)) - var/amount = input("Amount:", "Transfer Plasma to [M]") as num - if(amount) - amount = abs(round(amount)) - if(powerc(amount)) - if(get_dist(src,M) <= 1) - M.adjustPlasma(amount) - adjustPlasma(-amount) - to_chat(M, "[src] has transfered [amount] plasma to you.") - to_chat(src, {"You have trasferred [amount] plasma to [M]"}) - else - to_chat(src, "You need to be closer.") - return - - -/mob/living/carbon/alien/humanoid/proc/corrosive_acid(atom/target) //If they right click to corrode, an error will flash if its an invalid target./N - set name = "Corrossive Acid (200)" - set desc = "Drench an object in acid, destroying it over time." - set category = "Alien" - - if(powerc(200)) - if(target in oview(1)) - if(target.acid_act(200, 100)) - visible_message("[src] vomits globs of vile stuff all over [target]. It begins to sizzle and melt under the bubbling mess of acid!") - adjustPlasma(-200) - else - to_chat(src, "You cannot dissolve this object.") - else - to_chat(src, "[target] is too far away.") - -/mob/living/carbon/alien/humanoid/proc/neurotoxin() // ok - set name = "Spit Neurotoxin (50)" - set desc = "Spits neurotoxin at someone, paralyzing them for a short time." - set category = "Alien" - var/obj/item/organ/internal/xenos/neurotoxin/organ = locate() in internal_organs - - if(powerc(50) && !organ.neurotoxin_cooldown) - adjustPlasma(-50) - visible_message("[src] spits neurotoxin!", "You spit neurotoxin.") - organ.neurotoxin_cooldown = TRUE - addtimer(VARSET_CALLBACK(organ, neurotoxin_cooldown, FALSE), organ.neurotoxin_cooldown_time) - - var/turf/T = loc - var/turf/U = get_step(src, dir) // Get the tile infront of the move, based on their direction - if(!isturf(U) || !isturf(T)) - return - - var/obj/item/projectile/bullet/neurotoxin/A = new /obj/item/projectile/bullet/neurotoxin(usr.loc) - A.current = U - A.firer = src - A.firer_source_atom = src - A.yo = U.y - T.y - A.xo = U.x - T.x - A.fire() - A.newtonian_move(get_dir(U, T)) - newtonian_move(get_dir(U, T)) - return - -/mob/living/carbon/alien/humanoid/proc/resin() // -- TLE - set name = "Secrete Resin" - set desc = "Secrete tough malleable resin." - set category = "Alien" - - var/list/resin_buildings = list("Resin Wall (55)" = image(icon = 'icons/obj/smooth_structures/alien/resin_wall.dmi', icon_state = "resin_wall-0"), - "Resin Nest (55)" = image(icon = 'icons/mob/alien.dmi', icon_state = "nest"), - "Resin Door (80)" = image(icon = 'icons/obj/smooth_structures/alien/resin_door.dmi', icon_state = "resin")) - var/choice = show_radial_menu(src, src, resin_buildings, src, radius = 40) - if(powerc(55, TRUE)) - var/built = FALSE - if(locate(/obj/structure/alien/resin) in get_turf(src)) - to_chat(src, "There is already a resin construction here.") - return - adjustPlasma(-55) - - switch(choice) - if("Resin Wall (55)") - new /obj/structure/alien/resin/wall(loc) - built = TRUE - if("Resin Nest (55)") - new /obj/structure/bed/nest(loc) - built = TRUE - if("Resin Door (80)") - if(powerc(25, TRUE)) - var/obj/structure/alien/resin/door/door = new(loc) - door.dir = dir - adjustPlasma(-25) - built = TRUE - else - to_chat(src, "Not enough plasma stored.") - adjustPlasma(55) - if(built) - visible_message("[src] vomits up a thick purple substance and shapes it!") - return - -/mob/living/carbon/alien/humanoid/verb/regurgitate() - set name = "Regurgitate" - set desc = "Empties the contents of your stomach" - set category = "Alien" - - if(powerc()) - if(LAZYLEN(stomach_contents)) - for(var/mob/M in src) - LAZYREMOVE(stomach_contents, M) - M.forceMove(drop_location()) - visible_message("[src] hurls out the contents of [p_their()] stomach!") - -/mob/living/carbon/proc/getPlasma() - var/obj/item/organ/internal/xenos/plasmavessel/vessel = get_int_organ(/obj/item/organ/internal/xenos/plasmavessel) - if(!vessel) return 0 - return vessel.stored_plasma - - -/mob/living/carbon/proc/adjustPlasma(amount) - var/obj/item/organ/internal/xenos/plasmavessel/vessel = get_int_organ(/obj/item/organ/internal/xenos/plasmavessel) - if(!vessel) return - vessel.stored_plasma = max(vessel.stored_plasma + amount,0) - vessel.stored_plasma = min(vessel.stored_plasma, vessel.max_plasma) //upper limit of max_plasma, lower limit of 0 - return 1 - -/mob/living/carbon/alien/adjustPlasma(amount) - . = ..() - updatePlasmaDisplay() - -/mob/living/carbon/proc/usePlasma(amount) - if(getPlasma() >= amount) - adjustPlasma(-amount) - return 1 - - return 0 diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/alien_drone.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/alien_drone.dm index 6b6ae6ecc41..1195a46e735 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/alien_drone.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/alien_drone.dm @@ -10,42 +10,17 @@ if(src.name == "alien drone") src.name = "alien drone ([rand(1, 1000)])" src.real_name = src.name + AddSpell(new /obj/effect/proc_holder/spell/alien_spell/evolve_queen) /mob/living/carbon/alien/humanoid/drone/get_caste_organs() . = ..() . += list( - /obj/item/organ/internal/xenos/plasmavessel/drone, - /obj/item/organ/internal/xenos/acidgland, - /obj/item/organ/internal/xenos/resinspinner, + /obj/item/organ/internal/alien/plasmavessel/drone, + /obj/item/organ/internal/alien/acidgland, + /obj/item/organ/internal/alien/resinspinner, ) //Drones use the same base as generic humanoids. //Drone verbs -/mob/living/carbon/alien/humanoid/drone/verb/evolve() // -- TLE - set name = "Evolve (500)" - set desc = "Produce an interal egg sac capable of spawning children. Only one queen can exist at a time." - set category = "Alien" - - if(powerc(500)) - // Queen check - var/no_queen = TRUE - for(var/mob/living/carbon/alien/humanoid/queen/Q in GLOB.alive_mob_list) - if(!Q.key && Q.get_int_organ(/obj/item/organ/internal/brain/)) - continue - no_queen = FALSE - - if(no_queen) - adjustPlasma(-500) - to_chat(src, "You begin to evolve!") - for(var/mob/O in viewers(src, null)) - O.show_message(text("[src] begins to twist and contort!"), 1) - var/mob/living/carbon/alien/humanoid/queen/new_xeno = new(loc) - mind.transfer_to(new_xeno) - new_xeno.mind.name = new_xeno.name - SSblackbox.record_feedback("tally", "alien_growth", 1, "queen") - qdel(src) - else - to_chat(src, "We already have an alive queen.") - return diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm index b070aaafa6b..e80f74cd6ef 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm @@ -14,14 +14,14 @@ /mob/living/carbon/alien/humanoid/hunter/get_caste_organs() . = ..() - . += /obj/item/organ/internal/xenos/plasmavessel/hunter + . += /obj/item/organ/internal/alien/plasmavessel/hunter /mob/living/carbon/alien/humanoid/hunter/handle_environment() if(m_intent == MOVE_INTENT_RUN || IS_HORIZONTAL(src)) ..() else - adjustPlasma(-heal_rate) + add_plasma(-heal_rate) //Hunter verbs diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm index 9427c6dfb97..bd3075eadf6 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm @@ -41,7 +41,7 @@ /mob/living/carbon/alien/humanoid/sentinel/get_caste_organs() . = ..() . += list( - /obj/item/organ/internal/xenos/plasmavessel, - /obj/item/organ/internal/xenos/acidgland, - /obj/item/organ/internal/xenos/neurotoxin, + /obj/item/organ/internal/alien/plasmavessel, + /obj/item/organ/internal/alien/acidgland, + /obj/item/organ/internal/alien/neurotoxin, ) diff --git a/code/modules/mob/living/carbon/alien/humanoid/empress.dm b/code/modules/mob/living/carbon/alien/humanoid/empress.dm index 9df61d2b684..4cebd349dd8 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/empress.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/empress.dm @@ -51,25 +51,9 @@ /mob/living/carbon/alien/humanoid/empress/get_caste_organs() . = ..() . += list( - /obj/item/organ/internal/xenos/plasmavessel/queen, - /obj/item/organ/internal/xenos/acidgland, - /obj/item/organ/internal/xenos/eggsac, - /obj/item/organ/internal/xenos/resinspinner, - /obj/item/organ/internal/xenos/neurotoxin, + /obj/item/organ/internal/alien/plasmavessel/queen, + /obj/item/organ/internal/alien/acidgland, + /obj/item/organ/internal/alien/eggsac, + /obj/item/organ/internal/alien/resinspinner, + /obj/item/organ/internal/alien/neurotoxin, ) - -/mob/living/carbon/alien/humanoid/empress/verb/lay_egg() - set name = "Lay Egg (250)" - set desc = "Lay an egg to produce huggers to impregnate prey with." - set category = "Alien" - - if(locate(/obj/structure/alien/egg) in get_turf(src)) - to_chat(src, "There's already an egg here.") - return - - if(powerc(250,1))//Can't plant eggs on spess tiles. That's silly. - adjustPlasma(-250) - for(var/mob/O in viewers(src, null)) - O.show_message(text("[src] has laid an egg!"), 1) - new /obj/structure/alien/egg(loc) - return diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 2926b893467..3be97ae7446 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -19,13 +19,14 @@ pass_flags = PASSTABLE //This is fine right now, if we're adding organ specific damage this needs to be updated -/mob/living/carbon/alien/humanoid/New() +/mob/living/carbon/alien/humanoid/Initialize(mapload) if(name == "alien") name = text("alien ([rand(1, 1000)])") real_name = name add_language("Xenomorph") add_language("Hivemind") - ..() + AddSpell(new /obj/effect/proc_holder/spell/alien_spell/regurgitate) + . = ..() AddComponent(/datum/component/footstep, FOOTSTEP_MOB_CLAW, 0.5, -11) /mob/living/carbon/alien/humanoid/Process_Spacemove(check_drift = 0) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm index b88688bcc75..5d0f1aff481 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid_defense.dm @@ -56,6 +56,6 @@ visible_message("[M] has attempted to disarm [src]!") /mob/living/carbon/alien/humanoid/do_attack_animation(atom/A, visual_effect_icon, obj/item/used_item, no_effect) - if(!no_effect && !visual_effect_icon) + if(!no_effect && !visual_effect_icon && !get_active_hand()) visual_effect_icon = ATTACK_EFFECT_CLAW ..() diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid_inventory.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid_inventory.dm index 64696c21664..d4b7ca7c9ca 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid_inventory.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid_inventory.dm @@ -12,6 +12,15 @@ l_store = null update_inv_pockets() +/mob/living/carbon/alien/humanoid/put_in_hands(obj/item/I) + if(!I) + return FALSE + if(put_in_active_hand(I)) + return TRUE + if(put_in_inactive_hand(I)) + return TRUE + return FALSE + /mob/living/carbon/alien/humanoid/attack_ui(slot_id) var/obj/item/W = get_active_hand() if(W) diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm index 093d279908d..47ecbfff889 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm @@ -34,35 +34,17 @@ /mob/living/carbon/alien/humanoid/queen/get_caste_organs() . = ..() . += list( - /obj/item/organ/internal/xenos/plasmavessel/queen, - /obj/item/organ/internal/xenos/acidgland, - /obj/item/organ/internal/xenos/eggsac, - /obj/item/organ/internal/xenos/resinspinner, - /obj/item/organ/internal/xenos/neurotoxin, + /obj/item/organ/internal/alien/plasmavessel/queen, + /obj/item/organ/internal/alien/acidgland, + /obj/item/organ/internal/alien/eggsac, + /obj/item/organ/internal/alien/resinspinner, + /obj/item/organ/internal/alien/neurotoxin, ) /mob/living/carbon/alien/humanoid/queen/can_inject(mob/user, error_msg, target_zone, penetrate_thick) return FALSE -//Queen verbs -/mob/living/carbon/alien/humanoid/queen/verb/lay_egg() - - set name = "Lay Egg (75)" - set desc = "Lay an egg to produce huggers to impregnate prey with." - set category = "Alien" - if(locate(/obj/structure/alien/egg) in get_turf(src)) - to_chat(src, "There's already an egg here.") - return - - if(powerc(75,1))//Can't plant eggs on spess tiles. That's silly. - adjustPlasma(-75) - for(var/mob/O in viewers(src, null)) - O.show_message(text("[src] has laid an egg!"), 1) - new /obj/structure/alien/egg(loc) - return - - /mob/living/carbon/alien/humanoid/queen/large icon = 'icons/mob/alienlarge.dmi' icon_state = "queen_s" diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm index 1e45eac294f..67e2956798d 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva.dm @@ -24,18 +24,18 @@ regenerate_icons() add_language("Xenomorph") add_language("Hivemind") + AddSpell(new /obj/effect/proc_holder/spell/alien_spell/evolve_larva) /mob/living/carbon/alien/larva/get_caste_organs() . = ..() - . += /obj/item/organ/internal/xenos/plasmavessel/larva + . += /obj/item/organ/internal/alien/plasmavessel/larva -//This needs to be fixed /mob/living/carbon/alien/larva/Stat() ..() stat(null, "Progress: [amount_grown]/[max_grown]") -/mob/living/carbon/alien/larva/adjustPlasma(amount) +/mob/living/carbon/alien/larva/add_plasma(amount) if(stat != DEAD && amount > 0) amount_grown = min(amount_grown + 1, max_grown) ..(amount) @@ -43,30 +43,24 @@ /mob/living/carbon/alien/larva/ex_act(severity) ..() - var/b_loss = null - var/f_loss = null + var/brute_loss = null + var/fire_loss = null switch(severity) if(1.0) gib() return - if(2.0) - - b_loss += 60 - - f_loss += 60 - + brute_loss += 60 + fire_loss += 60 AdjustEarDamage(30, 120) - if(3.0) - b_loss += 30 + brute_loss += 30 if(prob(50)) Paralyse(2 SECONDS) AdjustEarDamage(15, 60) - adjustBruteLoss(b_loss) - adjustFireLoss(f_loss) - + adjustBruteLoss(brute_loss) + adjustFireLoss(fire_loss) updatehealth() //can't equip anything @@ -74,7 +68,7 @@ return /mob/living/carbon/alien/larva/restrained() - return 0 + return FALSE /mob/living/carbon/alien/larva/var/temperature_resistance = T0C+75 diff --git a/code/modules/mob/living/carbon/alien/larva/larva_powers.dm b/code/modules/mob/living/carbon/alien/larva/larva_powers.dm index 60c7906732b..ebd50ef671f 100644 --- a/code/modules/mob/living/carbon/alien/larva/larva_powers.dm +++ b/code/modules/mob/living/carbon/alien/larva/larva_powers.dm @@ -1,4 +1,3 @@ - /mob/living/carbon/alien/larva/verb/hide() set name = "Hide" set desc = "Allows to hide beneath tables or certain items. Toggled on or off." @@ -14,42 +13,3 @@ layer = MOB_LAYER visible_message("[src] slowly peeks up from the ground...", "You have stopped hiding.") -/mob/living/carbon/alien/larva/verb/evolve() - set name = "Evolve" - set desc = "Evolve into a fully grown Alien." - set category = "Alien" - - if(stat != CONSCIOUS) - return - - if(handcuffed || legcuffed) - to_chat(src, "You cannot evolve when you are cuffed.") - - if(amount_grown >= max_grown) //TODO ~Carn - //green is impossible to read, so i made these blue and changed the formatting slightly - to_chat(src, "You are growing into a beautiful alien! It is time to choose a caste.") - to_chat(src, "There are three to choose from:") - to_chat(src, "Hunters are strong and agile, able to hunt away from the hive and rapidly move through ventilation shafts. Hunters generate plasma slowly and have low reserves.") - to_chat(src, "Sentinels are tasked with protecting the hive and are deadly up close and at a range. They are not as physically imposing nor fast as the hunters.") - to_chat(src, "Drones are the working class, offering the largest plasma storage and generation. They are the only caste which may evolve again, turning into the dreaded alien queen.") - var/alien_caste = alert(src, "Please choose which alien caste you shall belong to.",,"Hunter","Sentinel","Drone") - - var/mob/living/carbon/alien/humanoid/new_xeno - switch(alien_caste) - if("Hunter") - new_xeno = new /mob/living/carbon/alien/humanoid/hunter(loc) - if("Sentinel") - new_xeno = new /mob/living/carbon/alien/humanoid/sentinel(loc) - if("Drone") - new_xeno = new /mob/living/carbon/alien/humanoid/drone(loc) - if(mind) - mind.transfer_to(new_xeno) - else - new_xeno.key = key - SSblackbox.record_feedback("tally", "alien_growth", 1, "[lowertext(alien_caste)]") - new_xeno.mind.name = new_xeno.name - qdel(src) - return - else - to_chat(src, "You are not fully grown.") - return diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index e9aea382af2..19bd97aecfe 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1051,7 +1051,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven /mob/living/carbon/Stat() ..() if(statpanel("Status")) - var/obj/item/organ/internal/xenos/plasmavessel/vessel = get_int_organ(/obj/item/organ/internal/xenos/plasmavessel) + var/obj/item/organ/internal/alien/plasmavessel/vessel = get_int_organ(/obj/item/organ/internal/alien/plasmavessel) if(vessel) stat(null, "Plasma Stored: [vessel.stored_plasma]/[vessel.max_plasma]") diff --git a/code/modules/mob/living/carbon/human/species/plasmaman.dm b/code/modules/mob/living/carbon/human/species/plasmaman.dm index eb120ccbef3..17e0069b7ce 100644 --- a/code/modules/mob/living/carbon/human/species/plasmaman.dm +++ b/code/modules/mob/living/carbon/human/species/plasmaman.dm @@ -167,7 +167,7 @@ if(R.id == "plasma" || R.id == "plasma_dust") H.adjustBruteLoss(-0.5*REAGENTS_EFFECT_MULTIPLIER) H.adjustFireLoss(-0.5*REAGENTS_EFFECT_MULTIPLIER) - H.adjustPlasma(20) + H.add_plasma(20) H.reagents.remove_reagent(R.id, REAGENTS_METABOLISM) return FALSE //Handling reagent removal on our own. Prevents plasma from dealing toxin damage to Plasmamen. diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic.dm index 0902782f704..a8703930ed5 100644 --- a/code/modules/reagents/chemistry/reagents/pyrotechnic.dm +++ b/code/modules/reagents/chemistry/reagents/pyrotechnic.dm @@ -168,7 +168,7 @@ holder.remove_reagent("epinephrine", 2) if(iscarbon(M)) var/mob/living/carbon/C = M - C.adjustPlasma(10) + C.add_plasma(10) return ..() | update_flags /datum/reagent/plasma/reaction_mob(mob/living/M, method = REAGENT_TOUCH, volume)//Splashing people with plasma is stronger than fuel! @@ -457,7 +457,7 @@ update_flags |= M.adjustToxLoss(3, FALSE) if(iscarbon(M)) var/mob/living/carbon/C = M - C.adjustPlasma(20) + C.add_plasma(20) return ..() | update_flags /datum/reagent/plasma_dust/reaction_mob(mob/living/M, method=REAGENT_TOUCH, volume)//Splashing people with plasma dust is stronger than fuel! diff --git a/code/modules/surgery/organs/subtypes/xenos.dm b/code/modules/surgery/organs/subtypes/xenos.dm index ac8c0544a71..d69ef938b7e 100644 --- a/code/modules/surgery/organs/subtypes/xenos.dm +++ b/code/modules/surgery/organs/subtypes/xenos.dm @@ -1,49 +1,48 @@ -/obj/item/organ/internal/xenos +/obj/item/organ/internal/alien origin_tech = "biotech=5" icon_state = "xgibmid2" var/list/alien_powers = list() tough = TRUE sterile = TRUE -///can be changed if xenos get an update.. -/obj/item/organ/internal/xenos/insert(mob/living/carbon/M, special = 0) +/// This adds and removes alien spells upon addition, if a noncarbon tries to do this well... I blame adminbus +/obj/item/organ/internal/alien/insert(mob/living/carbon/M, special = 0) ..() - for(var/P in alien_powers) - M.verbs |= P + for(var/powers_to_add in alien_powers) + M.AddSpell(new powers_to_add) -/obj/item/organ/internal/xenos/remove(mob/living/carbon/M, special = 0) - for(var/P in alien_powers) - M.verbs -= P +/obj/item/organ/internal/alien/remove(mob/living/carbon/M, special = 0) + for(var/powers_to_remove in alien_powers) + M.RemoveSpell(new powers_to_remove) . = ..() -/obj/item/organ/internal/xenos/prepare_eat() +/obj/item/organ/internal/alien/prepare_eat() var/obj/S = ..() S.reagents.add_reagent("sacid", 10) return S //XENOMORPH ORGANS -/obj/item/organ/internal/xenos/plasmavessel +/obj/item/organ/internal/alien/plasmavessel name = "xeno plasma vessel" icon_state = "plasma" w_class = WEIGHT_CLASS_NORMAL origin_tech = "biotech=5;plasmatech=4" parent_organ = "chest" slot = "plasmavessel" - alien_powers = list(/mob/living/carbon/alien/humanoid/verb/plant, /mob/living/carbon/alien/humanoid/verb/transfer_plasma) - + alien_powers = list(/obj/effect/proc_holder/spell/alien_spell/plant_weeds, /obj/effect/proc_holder/spell/touch/alien_spell/transfer_plasma) var/stored_plasma = 0 var/max_plasma = 500 var/heal_rate = 5 var/plasma_rate = 10 -/obj/item/organ/internal/xenos/plasmavessel/prepare_eat() +/obj/item/organ/internal/alien/plasmavessel/prepare_eat() var/obj/S = ..() S.reagents.add_reagent("plasma", stored_plasma/10) return S -/obj/item/organ/internal/xenos/plasmavessel/queen +/obj/item/organ/internal/alien/plasmavessel/queen name = "bloated xeno plasma vessel" icon_state = "plasma_large" origin_tech = "biotech=6;plasmatech=4" @@ -51,112 +50,107 @@ max_plasma = 500 plasma_rate = 25 -/obj/item/organ/internal/xenos/plasmavessel/drone +/obj/item/organ/internal/alien/plasmavessel/drone name = "large xeno plasma vessel" icon_state = "plasma_large" stored_plasma = 200 max_plasma = 500 -/obj/item/organ/internal/xenos/plasmavessel/sentinel +/obj/item/organ/internal/alien/plasmavessel/sentinel stored_plasma = 100 max_plasma = 250 -/obj/item/organ/internal/xenos/plasmavessel/hunter +/obj/item/organ/internal/alien/plasmavessel/hunter name = "small xeno plasma vessel" icon_state = "plasma_tiny" stored_plasma = 100 max_plasma = 150 - alien_powers = list(/mob/living/carbon/alien/humanoid/verb/plant) + alien_powers = list(/obj/effect/proc_holder/spell/alien_spell/plant_weeds) -/obj/item/organ/internal/xenos/plasmavessel/larva +/obj/item/organ/internal/alien/plasmavessel/larva name = "tiny xeno plasma vessel" icon_state = "plasma_tiny" max_plasma = 100 + alien_powers = list(/obj/effect/proc_holder/spell/alien_spell/plant_weeds) -/obj/item/organ/internal/xenos/plasmavessel/on_life() +/obj/item/organ/internal/alien/plasmavessel/on_life() //If there are alien weeds on the ground then heal if needed or give some plasma if(locate(/obj/structure/alien/weeds) in owner.loc) if(owner.health >= owner.maxHealth) - owner.adjustPlasma(plasma_rate) + owner.add_plasma(plasma_rate) else var/heal_amt = heal_rate if(!isalien(owner)) heal_amt *= 0.2 - owner.adjustPlasma(plasma_rate*0.5) + owner.add_plasma((plasma_rate*0.5)) owner.adjustBruteLoss(-heal_amt) owner.adjustFireLoss(-heal_amt) owner.adjustOxyLoss(-heal_amt) owner.adjustCloneLoss(-heal_amt) -/obj/item/organ/internal/xenos/plasmavessel/insert(mob/living/carbon/M, special = 0) +/obj/item/organ/internal/alien/plasmavessel/insert(mob/living/carbon/M, special = 0) ..() - if(isalien(M)) - var/mob/living/carbon/alien/A = M - A.updatePlasmaDisplay() + M.update_plasma_display(M) /obj/item/organ/internal/alien/plasmavessel/remove(mob/living/carbon/M, special = 0) . =..() - if(isalien(M)) - var/mob/living/carbon/alien/A = M - A.updatePlasmaDisplay() + M.update_plasma_display(M) -/obj/item/organ/internal/xenos/acidgland +/obj/item/organ/internal/alien/acidgland name = "xeno acid gland" icon_state = "acid" parent_organ = "head" slot = "acid" origin_tech = "biotech=5;materials=2;combat=2" - alien_powers = list(/mob/living/carbon/alien/humanoid/proc/corrosive_acid) + alien_powers = list(/obj/effect/proc_holder/spell/touch/alien_spell/corrosive_acid) -/obj/item/organ/internal/xenos/hivenode +/obj/item/organ/internal/alien/hivenode name = "xeno hive node" icon_state = "hivenode" parent_organ = "head" slot = "hivenode" origin_tech = "biotech=5;magnets=4;bluespace=3" w_class = WEIGHT_CLASS_TINY - alien_powers = list(/mob/living/carbon/alien/humanoid/verb/whisp) + alien_powers = list(/obj/effect/proc_holder/spell/alien_spell/whisper) -/obj/item/organ/internal/xenos/hivenode/insert(mob/living/carbon/M, special = 0) +/obj/item/organ/internal/alien/hivenode/insert(mob/living/carbon/M, special = 0) ..() M.faction |= "alien" M.add_language("Hivemind") M.add_language("Xenomorph") ADD_TRAIT(M, TRAIT_XENO_IMMUNE, "xeno immune") -/obj/item/organ/internal/xenos/hivenode/remove(mob/living/carbon/M, special = 0) +/obj/item/organ/internal/alien/hivenode/remove(mob/living/carbon/M, special = 0) M.faction -= "alien" M.remove_language("Hivemind") M.remove_language("Xenomorph") REMOVE_TRAIT(M, TRAIT_XENO_IMMUNE, "xeno immune") . = ..() -/obj/item/organ/internal/xenos/neurotoxin +/obj/item/organ/internal/alien/neurotoxin name = "xeno neurotoxin gland" icon_state = "neurotox" parent_organ = "head" slot = "neurotox" origin_tech = "biotech=5;combat=5" - alien_powers = list(/mob/living/carbon/alien/humanoid/proc/neurotoxin) - var/neurotoxin_cooldown = FALSE - var/neurotoxin_cooldown_time = 5 SECONDS + alien_powers = list(/obj/effect/proc_holder/spell/alien_spell/neurotoxin) -/obj/item/organ/internal/xenos/resinspinner +/obj/item/organ/internal/alien/resinspinner name = "xeno resin organ"//...there tiger.... parent_organ = "mouth" icon_state = "liver-x" slot = "spinner" origin_tech = "biotech=5;materials=4" - alien_powers = list(/mob/living/carbon/alien/humanoid/proc/resin) + alien_powers = list(/obj/effect/proc_holder/spell/alien_spell/build_resin) -/obj/item/organ/internal/xenos/eggsac +/obj/item/organ/internal/alien/eggsac name = "xeno egg sac" icon_state = "eggsac" parent_organ = "groin" slot = "eggsac" w_class = WEIGHT_CLASS_BULKY origin_tech = "biotech=6" - alien_powers = list(/mob/living/carbon/alien/humanoid/queen/verb/lay_egg) + alien_powers = list(/obj/effect/proc_holder/spell/alien_spell/plant_weeds/eggs) diff --git a/icons/mob/actions/actions.dmi b/icons/mob/actions/actions.dmi index 8e034e98b84..0f92874839f 100644 Binary files a/icons/mob/actions/actions.dmi and b/icons/mob/actions/actions.dmi differ diff --git a/icons/obj/items.dmi b/icons/obj/items.dmi index 97ab37d8a33..e70a99d2908 100644 Binary files a/icons/obj/items.dmi and b/icons/obj/items.dmi differ diff --git a/paradise.dme b/paradise.dme index 65a3afe4fc4..0a90724c1f1 100644 --- a/paradise.dme +++ b/paradise.dme @@ -465,6 +465,7 @@ #include "code\datums\ruins\space_ruins.dm" #include "code\datums\spell_cooldown\spell_charges.dm" #include "code\datums\spell_cooldown\spell_cooldown.dm" +#include "code\datums\spell_handler\alien_spell_handler.dm" #include "code\datums\spell_handler\morph.dm" #include "code\datums\spell_handler\spell_handler.dm" #include "code\datums\spell_handler\vampire.dm" @@ -517,6 +518,18 @@ #include "code\datums\spells\trigger.dm" #include "code\datums\spells\turf_teleport.dm" #include "code\datums\spells\wizard.dm" +#include "code\datums\spells\alien_spells\basetype_alien_spell.dm" +#include "code\datums\spells\alien_spells\basetype_alien_touch.dm" +#include "code\datums\spells\alien_spells\build_resin_structure.dm" +#include "code\datums\spells\alien_spells\corrosive_acid_spit.dm" +#include "code\datums\spells\alien_spells\larva_evolve.dm" +#include "code\datums\spells\alien_spells\lay_alien_eggs.dm" +#include "code\datums\spells\alien_spells\neurotoxin_spit.dm" +#include "code\datums\spells\alien_spells\plasma_weeds.dm" +#include "code\datums\spells\alien_spells\queen_evolve.dm" +#include "code\datums\spells\alien_spells\regurgitate.dm" +#include "code\datums\spells\alien_spells\transfer_plasma.dm" +#include "code\datums\spells\alien_spells\whisper.dm" #include "code\datums\status_effects\blob_burst.dm" #include "code\datums\status_effects\buffs.dm" #include "code\datums\status_effects\debuffs.dm" @@ -1940,7 +1953,6 @@ #include "code\modules\mob\living\carbon\alien\alien_life.dm" #include "code\modules\mob\living\carbon\alien\alien_login.dm" #include "code\modules\mob\living\carbon\alien\alien_logout.dm" -#include "code\modules\mob\living\carbon\alien\humanoid\alien_powers.dm" #include "code\modules\mob\living\carbon\alien\humanoid\empress.dm" #include "code\modules\mob\living\carbon\alien\humanoid\humanoid.dm" #include "code\modules\mob\living\carbon\alien\humanoid\humanoid_defense.dm"