diff --git a/code/_onclick/other_mobs.dm b/code/_onclick/other_mobs.dm index 06c2d9dd467..4b92fca5c50 100644 --- a/code/_onclick/other_mobs.dm +++ b/code/_onclick/other_mobs.dm @@ -265,9 +265,21 @@ pAI */ -/mob/living/silicon/pai/UnarmedAttack(atom/attack_target, proximity_flag, list/modifiers)//Stops runtimes due to attack_animal being the default +/mob/living/silicon/pai/resolve_unarmed_attack(atom/attack_target, list/modifiers) + attack_target.attack_pai(src, modifiers) + +/mob/living/silicon/pai/resolve_right_click_attack(atom/target, list/modifiers) + return target.attack_pai_secondary(src, modifiers) + +/atom/proc/attack_pai(mob/user, list/modifiers) return +/** + * Called when a pAI right clicks an atom. + * Returns a SECONDARY_ATTACK_* value. + */ +/atom/proc/attack_pai_secondary(mob/user, list/modifiers) + return SECONDARY_ATTACK_CALL_NORMAL /* Simple animals diff --git a/code/game/objects/structures/ladders.dm b/code/game/objects/structures/ladders.dm index 15247ecc7d9..76a6cdadea0 100644 --- a/code/game/objects/structures/ladders.dm +++ b/code/game/objects/structures/ladders.dm @@ -157,7 +157,7 @@ going_up = TRUE if("Down") going_up = FALSE - if("Cancel") + else return if(is_ghost || !travel_time) @@ -251,7 +251,18 @@ /obj/structure/ladder/attack_robot_secondary(mob/living/silicon/robot/user) . = ..() if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN || !user.Adjacent(src)) - return SECONDARY_ATTACK_CONTINUE_CHAIN + return + use(user, going_up = FALSE) + return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN + +/obj/structure/ladder/attack_pai(mob/user, list/modifiers) + use(user) + return TRUE + +/obj/structure/ladder/attack_pai_secondary(mob/user, list/modifiers) + . = ..() + if(. == SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN) + return use(user, going_up = FALSE) return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN diff --git a/code/modules/mob/living/simple_animal/hostile/lightgeist.dm b/code/modules/mob/living/simple_animal/hostile/lightgeist.dm new file mode 100644 index 00000000000..f2acd34730b --- /dev/null +++ b/code/modules/mob/living/simple_animal/hostile/lightgeist.dm @@ -0,0 +1,73 @@ +/** + * A small critter meant to heal other living mobs and unable to interact with almost everything else. + * The procs related to its unarmed attacks can be found in _onclick/other_mobs.dm (attack_lightgeist) + */ +/mob/living/simple_animal/hostile/lightgeist + name = "lightgeist" + desc = "This small floating creature is a completely unknown form of life... being near it fills you with a sense of tranquility." + icon_state = "lightgeist" + icon_living = "lightgeist" + icon_dead = "butterfly_dead" + turns_per_move = 1 + response_help_continuous = "waves away" + response_help_simple = "wave away" + response_disarm_continuous = "brushes aside" + response_disarm_simple = "brush aside" + response_harm_continuous = "disrupts" + response_harm_simple = "disrupt" + speak_emote = list("oscillates") + maxHealth = 2 + health = 2 + harm_intent_damage = 5 + melee_damage_lower = 5 + melee_damage_upper = 5 + friendly_verb_continuous = "taps" + friendly_verb_simple = "tap" + density = FALSE + pass_flags = PASSTABLE | PASSGRILLE | PASSMOB + mob_size = MOB_SIZE_TINY + gold_core_spawnable = HOSTILE_SPAWN + verb_say = "warps" + verb_ask = "floats inquisitively" + verb_exclaim = "zaps" + verb_yell = "bangs" + initial_language_holder = /datum/language_holder/lightbringer + damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0) + light_range = 4 + faction = list("neutral") + del_on_death = TRUE + unsuitable_atmos_damage = 0 + minbodytemp = 0 + maxbodytemp = 1500 + obj_damage = 0 + environment_smash = ENVIRONMENT_SMASH_NONE + AIStatus = AI_OFF + stop_automated_movement = TRUE + +/mob/living/simple_animal/hostile/lightgeist/Initialize(mapload) + . = ..() + AddElement(/datum/element/simple_flying) + remove_verb(src, /mob/living/verb/pulled) + remove_verb(src, /mob/verb/me_verb) + var/datum/atom_hud/medsensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] + medsensor.show_to(src) + + ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) + +/mob/living/simple_animal/hostile/lightgeist/ghost() + . = ..() + if(.) + death() + +/mob/living/simple_animal/hostile/lightgeist/AttackingTarget() + if(istype(target, /obj/structure/ladder)) //special case where lightgeists can use ladders properly. + var/obj/structure/ladder/laddy = target + laddy.use(src) + return + if(!isliving(target) || target == src) + return + var/mob/living/living_target = target + if(living_target.stat != DEAD) + living_target.heal_overall_damage(melee_damage_upper, melee_damage_upper) + new /obj/effect/temp_visual/heal(get_turf(target), "#80F5FF") + visible_message(span_notice("[src] mends the wounds of [target]."),span_notice("You mend the wounds of [target].")) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm index 9041188a44b..7660a491ee3 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/colossus.dm @@ -478,71 +478,6 @@ if(istype(ghost)) attack_ghost(ghost) -/mob/living/simple_animal/hostile/lightgeist - name = "lightgeist" - desc = "This small floating creature is a completely unknown form of life... being near it fills you with a sense of tranquility." - icon_state = "lightgeist" - icon_living = "lightgeist" - icon_dead = "butterfly_dead" - turns_per_move = 1 - response_help_continuous = "waves away" - response_help_simple = "wave away" - response_disarm_continuous = "brushes aside" - response_disarm_simple = "brush aside" - response_harm_continuous = "disrupts" - response_harm_simple = "disrupt" - speak_emote = list("oscillates") - maxHealth = 2 - health = 2 - harm_intent_damage = 5 - melee_damage_lower = 5 - melee_damage_upper = 5 - friendly_verb_continuous = "taps" - friendly_verb_simple = "tap" - density = FALSE - pass_flags = PASSTABLE | PASSGRILLE | PASSMOB - mob_size = MOB_SIZE_TINY - gold_core_spawnable = HOSTILE_SPAWN - verb_say = "warps" - verb_ask = "floats inquisitively" - verb_exclaim = "zaps" - verb_yell = "bangs" - initial_language_holder = /datum/language_holder/lightbringer - damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0) - light_range = 4 - faction = list("neutral") - del_on_death = TRUE - unsuitable_atmos_damage = 0 - minbodytemp = 0 - maxbodytemp = 1500 - obj_damage = 0 - environment_smash = ENVIRONMENT_SMASH_NONE - AIStatus = AI_OFF - stop_automated_movement = TRUE - -/mob/living/simple_animal/hostile/lightgeist/Initialize(mapload) - . = ..() - AddElement(/datum/element/simple_flying) - remove_verb(src, /mob/living/verb/pulled) - remove_verb(src, /mob/verb/me_verb) - var/datum/atom_hud/medsensor = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED] - medsensor.show_to(src) - - ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) - -/mob/living/simple_animal/hostile/lightgeist/AttackingTarget() - if(isliving(target) && target != src) - var/mob/living/L = target - if(L.stat != DEAD) - L.heal_overall_damage(melee_damage_upper, melee_damage_upper) - new /obj/effect/temp_visual/heal(get_turf(target), "#80F5FF") - visible_message(span_notice("[src] mends the wounds of [target]."),span_notice("You mend the wounds of [target].")) - -/mob/living/simple_animal/hostile/lightgeist/ghost() - . = ..() - if(.) - death() - /obj/machinery/anomalous_crystal/possessor //Allows you to bodyjack small animals, then exit them at your leisure, but you can only do this once per activation. Because they blow up. Also, if the bodyjacked animal dies, SO DO YOU. observer_desc = "When activated, this crystal allows you to take over small animals, and then exit them at the possessors leisure. Exiting the animal kills it, and if you die while possessing the animal, you die as well." activation_method = ACTIVATE_TOUCH diff --git a/tgstation.dme b/tgstation.dme index c04f8c7bd79..5046710be45 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -3794,6 +3794,7 @@ #include "code\modules\mob\living\simple_animal\hostile\hostile.dm" #include "code\modules\mob\living\simple_animal\hostile\illusion.dm" #include "code\modules\mob\living\simple_animal\hostile\killertomato.dm" +#include "code\modules\mob\living\simple_animal\hostile\lightgeist.dm" #include "code\modules\mob\living\simple_animal\hostile\mecha_pilot.dm" #include "code\modules\mob\living\simple_animal\hostile\mimic.dm" #include "code\modules\mob\living\simple_animal\hostile\mushroom.dm"