From 973fdb61c68f36806db6c435c5c2ac563c77a951 Mon Sep 17 00:00:00 2001 From: Seris02 Date: Sat, 28 Dec 2019 17:33:19 +0800 Subject: [PATCH 1/5] probably fixes pandoras attacking their owners --- .../hostile/megafauna/hierophant.dm | 6 ++- .../hostile/mining_mobs/elites/elite.dm | 44 ++++++++-------- .../hostile/mining_mobs/elites/pandora.dm | 50 +++++++++---------- 3 files changed, 53 insertions(+), 47 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index 397d40925b..cc710ad8ce 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -594,12 +594,14 @@ Difficulty: Normal var/list/hit_things = list() //we hit these already, ignore them var/friendly_fire_check = FALSE var/bursting = FALSE //if we're bursting and need to hit anyone crossing us + var/list/nohurt -/obj/effect/temp_visual/hierophant/blast/Initialize(mapload, new_caster, friendly_fire, list/only_hit_once) +/obj/effect/temp_visual/hierophant/blast/Initialize(mapload, new_caster, friendly_fire, list/only_hit_once, list/donthurt = list()) . = ..() if(only_hit_once) hit_things = only_hit_once friendly_fire_check = friendly_fire + nohurt = donthurt if(new_caster) hit_things += new_caster if(ismineralturf(loc)) //drill mineral turfs @@ -627,6 +629,8 @@ Difficulty: Normal if(!damage) return for(var/mob/living/L in T.contents - hit_things) //find and damage mobs... + if (L in nohurt) + continue hit_things += L if((friendly_fire_check && caster && caster.faction_check_mob(L)) || L.stat == DEAD) continue diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm index 04a1b4a468..0a8320788e 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm @@ -24,7 +24,8 @@ var/list/attack_action_types = list() var/can_talk = FALSE var/obj/loot_drop = null - + var/owner + //Gives player-controlled variants the ability to swap attacks /mob/living/simple_animal/hostile/asteroid/elite/Initialize(mapload) . = ..() @@ -53,14 +54,14 @@ if(ismineralturf(target)) var/turf/closed/mineral/M = target M.gets_drilled() - + //Elites can't talk (normally)! /mob/living/simple_animal/hostile/asteroid/elite/say(message, bubble_type, var/list/spans = list(), sanitize = TRUE, datum/language/language = null, ignore_spam = FALSE, forced = null) if(can_talk) . = ..() return TRUE return FALSE - + /*Basic setup for elite attacks, based on Whoneedspace's megafauna attack setup. While using this makes the system rely on OnFire, it still gives options for timers not tied to OnFire, and it makes using attacks consistent accross the board for player-controlled elites.*/ @@ -82,11 +83,11 @@ While using this makes the system rely on OnFire, it still gives options for tim /datum/action/innate/elite_attack/Activate() M.chosen_attack = chosen_attack_num to_chat(M, chosen_message) - + /mob/living/simple_animal/hostile/asteroid/elite/updatehealth() . = ..() update_health_hud() - + /mob/living/simple_animal/hostile/asteroid/elite/update_health_hud() if(hud_used) var/severity = 0 @@ -144,7 +145,7 @@ While using this makes the system rely on OnFire, it still gives options for tim gpstag = "Menacing Signal" desc = "You're not quite sure how a signal can be menacing." invisibility = 100 - + /obj/structure/elite_tumor/attack_hand(mob/user) . = ..() if(ishuman(user)) @@ -179,7 +180,7 @@ While using this makes the system rely on OnFire, it still gives options for tim activity = TUMOR_INACTIVE activator = null - + obj/structure/elite_tumor/proc/spawn_elite(var/mob/dead/observer/elitemind) var/selectedspawn = pick(potentialspawns) mychild = new selectedspawn(loc) @@ -199,18 +200,18 @@ obj/structure/elite_tumor/proc/return_elite() if(boosted) mychild.maxHealth = mychild.maxHealth * 2 mychild.health = mychild.maxHealth - + /obj/structure/elite_tumor/Initialize(mapload) . = ..() internal = new/obj/item/gps/internal/elite(src) START_PROCESSING(SSobj, src) - + /obj/structure/elite_tumor/Destroy() STOP_PROCESSING(SSobj, src) mychild = null activator = null return ..() - + /obj/structure/elite_tumor/process() if(isturf(loc)) for(var/mob/living/simple_animal/hostile/asteroid/elite/elitehere in loc) @@ -218,7 +219,7 @@ obj/structure/elite_tumor/proc/return_elite() mychild.adjustHealth(-mychild.maxHealth*0.05) var/obj/effect/temp_visual/heal/H = new /obj/effect/temp_visual/heal(get_turf(mychild)) H.color = "#FF0000" - + /obj/structure/elite_tumor/attackby(obj/item/I, mob/user, params) . = ..() if(istype(I, /obj/item/organ/regenerative_core) && activity == TUMOR_INACTIVE && !boosted) @@ -232,7 +233,7 @@ obj/structure/elite_tumor/proc/return_elite() desc = "[desc] This one seems to glow with a strong intensity." qdel(core) return TRUE - + /obj/structure/elite_tumor/proc/arena_checks() if(activity != TUMOR_ACTIVE || QDELETED(src)) return @@ -240,13 +241,13 @@ obj/structure/elite_tumor/proc/return_elite() INVOKE_ASYNC(src, .proc/arena_trap) //Gets another arena trap queued up for when this one runs out. INVOKE_ASYNC(src, .proc/border_check) //Checks to see if our fighters got out of the arena somehow. addtimer(CALLBACK(src, .proc/arena_checks), 50) - + /obj/structure/elite_tumor/proc/fighters_check() if(activator != null && activator.stat == DEAD || activity == TUMOR_ACTIVE && QDELETED(activator)) onEliteWon() if(mychild != null && mychild.stat == DEAD || activity == TUMOR_ACTIVE && QDELETED(mychild)) onEliteLoss() - + /obj/structure/elite_tumor/proc/arena_trap() var/turf/T = get_turf(src) if(loc == null) @@ -257,7 +258,7 @@ obj/structure/elite_tumor/proc/return_elite() newwall = new /obj/effect/temp_visual/elite_tumor_wall(t, src) newwall.activator = src.activator newwall.ourelite = src.mychild - + /obj/structure/elite_tumor/proc/border_check() if(activator != null && get_dist(src, activator) >= 12) activator.forceMove(loc) @@ -267,7 +268,7 @@ obj/structure/elite_tumor/proc/return_elite() mychild.forceMove(loc) visible_message("[mychild] suddenly reappears above [src]!") playsound(loc,'sound/effects/phasein.ogg', 200, 0, 50, TRUE, TRUE) - + obj/structure/elite_tumor/proc/onEliteLoss() playsound(loc,'sound/effects/tendril_destroyed.ogg', 200, 0, 50, TRUE, TRUE) visible_message("[src] begins to convulse violently before beginning to dissipate.") @@ -286,7 +287,7 @@ obj/structure/elite_tumor/proc/onEliteLoss() mychild = null activator = null qdel(src) - + obj/structure/elite_tumor/proc/onEliteWon() activity = TUMOR_PASSIVE activator = null @@ -300,7 +301,7 @@ obj/structure/elite_tumor/proc/onEliteWon() to_chat(mychild, "As the life in the activator's eyes fade, the forcefield around you dies out and you feel your power subside.\nDespite this inferno being your home, you feel as if you aren't welcome here anymore.\nWithout any guidance, your purpose is now for you to decide.") to_chat(mychild, "Your max health has been halved, but can now heal by standing on your tumor. Note, it's your only way to heal.\nBear in mind, if anyone interacts with your tumor, you'll be resummoned here to carry out another fight. In such a case, you will regain your full max health.\nAlso, be weary of your fellow inhabitants, they likely won't be happy to see you!") to_chat(mychild, "Note that you are a lavaland monster, and thus not allied to the station. You should not cooperate or act friendly with any station crew unless under extreme circumstances!") - + /obj/item/tumor_shard name = "tumor shard" desc = "A strange, sharp, crystal shard from an odd tumor on Lavaland. Stabbing the corpse of a lavaland elite with this will revive them, assuming their soul still lingers. Revived lavaland elites only have half their max health, but are completely loyal to their reviver." @@ -313,7 +314,7 @@ obj/structure/elite_tumor/proc/onEliteWon() w_class = WEIGHT_CLASS_SMALL throw_speed = 3 throw_range = 5 - + /obj/item/tumor_shard/afterattack(atom/target, mob/user, proximity_flag) . = ..() if(istype(target, /mob/living/simple_animal/hostile/asteroid/elite) && proximity_flag) @@ -331,10 +332,11 @@ obj/structure/elite_tumor/proc/onEliteWon() E.health = E.maxHealth E.desc = "[E.desc] However, this one appears appears less wild in nature, and calmer around people." E.sentience_type = SENTIENCE_ORGANIC + E.owner = user qdel(src) else to_chat(user, "[src] only works on the corpse of a sentient lavaland elite.") - + /obj/effect/temp_visual/elite_tumor_wall name = "magic wall" icon = 'icons/turf/walls/hierophant_wall_temp.dmi' @@ -347,7 +349,7 @@ obj/structure/elite_tumor/proc/onEliteWon() color = rgb(255,0,0) light_range = MINIMUM_USEFUL_LIGHT_RANGE light_color = LIGHT_COLOR_RED - + /obj/effect/temp_visual/elite_tumor_wall/Initialize(mapload, new_caster) . = ..() queue_smooth_neighbors(src) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm index 540470d505..a76d9ed216 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm @@ -44,34 +44,34 @@ /datum/action/innate/elite_attack/magic_box, /datum/action/innate/elite_attack/pandora_teleport, /datum/action/innate/elite_attack/aoe_squares) - + var/sing_shot_length = 8 var/cooldown_time = 20 - + /datum/action/innate/elite_attack/singular_shot name = "Singular Shot" button_icon_state = "singular_shot" chosen_message = "You are now creating a single linear magic square." chosen_attack_num = SINGULAR_SHOT - + /datum/action/innate/elite_attack/magic_box name = "Magic Box" button_icon_state = "magic_box" chosen_message = "You are now attacking with a box of magic squares." chosen_attack_num = MAGIC_BOX - + /datum/action/innate/elite_attack/pandora_teleport name = "Line Teleport" button_icon_state = "pandora_teleport" chosen_message = "You will now teleport to your target." chosen_attack_num = PANDORA_TELEPORT - + /datum/action/innate/elite_attack/aoe_squares name = "AOE Blast" button_icon_state = "aoe_squares" chosen_message = "Your attacks will spawn an AOE blast at your target location." chosen_attack_num = AOE_SQUARES - + /mob/living/simple_animal/hostile/asteroid/elite/pandora/OpenFire() if(client) switch(chosen_attack) @@ -94,7 +94,7 @@ pandora_teleport(target) if(AOE_SQUARES) aoe_squares(target) - + /mob/living/simple_animal/hostile/asteroid/elite/pandora/Life() . = ..() if(health >= maxHealth * 0.5) @@ -105,28 +105,28 @@ return else cooldown_time = 10 - -/mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/singular_shot(target) + +/mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/singular_shot(target) ranged_cooldown = world.time + (cooldown_time * 0.5) var/dir_to_target = get_dir(get_turf(src), get_turf(target)) var/turf/T = get_step(get_turf(src), dir_to_target) singular_shot_line(sing_shot_length, dir_to_target, T) - + /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/singular_shot_line(var/procsleft, var/angleused, var/turf/T) if(procsleft <= 0) return - new /obj/effect/temp_visual/hierophant/blast/pandora(T, src) + new /obj/effect/temp_visual/hierophant/blast/pandora(T, src, donthurt = list(owner)) T = get_step(T, angleused) procsleft = procsleft - 1 addtimer(CALLBACK(src, .proc/singular_shot_line, procsleft, angleused, T), 2) - + /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/magic_box(target) ranged_cooldown = world.time + cooldown_time var/turf/T = get_turf(target) for(var/t in spiral_range_turfs(3, T)) if(get_dist(t, T) > 1) - new /obj/effect/temp_visual/hierophant/blast/pandora(t, src) - + new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, donthurt = list(owner)) + /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/pandora_teleport(target) ranged_cooldown = world.time + cooldown_time var/turf/T = get_turf(target) @@ -135,45 +135,45 @@ new /obj/effect/temp_visual/hierophant/telegraph(source, src) playsound(source,'sound/machines/airlockopen.ogg', 200, 1) addtimer(CALLBACK(src, .proc/pandora_teleport_2, T, source), 2) - + /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/pandora_teleport_2(var/turf/T, var/turf/source) new /obj/effect/temp_visual/hierophant/telegraph/teleport(T, src) new /obj/effect/temp_visual/hierophant/telegraph/teleport(source, src) for(var/t in RANGE_TURFS(1, T)) - new /obj/effect/temp_visual/hierophant/blast/pandora(t, src) + new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, donthurt = list(owner)) for(var/t in RANGE_TURFS(1, source)) - new /obj/effect/temp_visual/hierophant/blast/pandora(t, src) + new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, donthurt = list(owner)) animate(src, alpha = 0, time = 2, easing = EASE_OUT) //fade out visible_message("[src] fades out!") density = FALSE addtimer(CALLBACK(src, .proc/pandora_teleport_3, T), 2) - + /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/pandora_teleport_3(var/turf/T) forceMove(T) animate(src, alpha = 255, time = 2, easing = EASE_IN) //fade IN density = TRUE visible_message("[src] fades in!") - + /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/aoe_squares(target) ranged_cooldown = world.time + cooldown_time var/turf/T = get_turf(target) - new /obj/effect/temp_visual/hierophant/blast/pandora(T, src) + new /obj/effect/temp_visual/hierophant/blast/pandora(T, src, donthurt = list(owner)) var/max_size = 2 addtimer(CALLBACK(src, .proc/aoe_squares_2, T, 0, max_size), 2) - + /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/aoe_squares_2(var/turf/T, var/ring, var/max_size) if(ring > max_size) return for(var/t in spiral_range_turfs(ring, T)) if(get_dist(t, T) == ring) - new /obj/effect/temp_visual/hierophant/blast/pandora(t, src) + new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, donthurt = list(owner)) addtimer(CALLBACK(src, .proc/aoe_squares_2, T, (ring + 1), max_size), 2) - + //The specific version of hiero's squares pandora uses /obj/effect/temp_visual/hierophant/blast/pandora damage = 20 monster_damage_boost = FALSE - + //Pandora's loot: Hope /obj/item/clothing/accessory/pandora_hope name = "Hope" @@ -181,7 +181,7 @@ icon = 'icons/obj/lavaland/elite_trophies.dmi' icon_state = "hope" resistance_flags = FIRE_PROOF - + /obj/item/clothing/accessory/pandora_hope/on_uniform_equip(obj/item/clothing/under/U, user) var/mob/living/L = user if(L && L.mind) From 2c26c3bdec1e252b15fd7b5e200c43770a89628f Mon Sep 17 00:00:00 2001 From: Seris02 <49109742+Seris02@users.noreply.github.com> Date: Sat, 28 Dec 2019 21:11:17 +0800 Subject: [PATCH 2/5] does the fix? --- .../mob/living/simple_animal/hostile/megafauna/hierophant.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index cc710ad8ce..d8e281e73b 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -596,11 +596,13 @@ Difficulty: Normal var/bursting = FALSE //if we're bursting and need to hit anyone crossing us var/list/nohurt -/obj/effect/temp_visual/hierophant/blast/Initialize(mapload, new_caster, friendly_fire, list/only_hit_once, list/donthurt = list()) +/obj/effect/temp_visual/hierophant/blast/Initialize(mapload, new_caster, friendly_fire, list/only_hit_once, list/donthurt) . = ..() if(only_hit_once) hit_things = only_hit_once friendly_fire_check = friendly_fire + if (!donthurt) + donthurt = list() nohurt = donthurt if(new_caster) hit_things += new_caster From 70744ef1714d06016e37f010b192fb8853a9759a Mon Sep 17 00:00:00 2001 From: Seris02 <49109742+Seris02@users.noreply.github.com> Date: Sun, 29 Dec 2019 00:19:19 +0800 Subject: [PATCH 3/5] ah --- .../living/simple_animal/hostile/megafauna/hierophant.dm | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index d8e281e73b..bacd340958 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -601,9 +601,8 @@ Difficulty: Normal if(only_hit_once) hit_things = only_hit_once friendly_fire_check = friendly_fire - if (!donthurt) - donthurt = list() - nohurt = donthurt + if(donthurt) + hit_things += donthurt if(new_caster) hit_things += new_caster if(ismineralturf(loc)) //drill mineral turfs @@ -631,8 +630,6 @@ Difficulty: Normal if(!damage) return for(var/mob/living/L in T.contents - hit_things) //find and damage mobs... - if (L in nohurt) - continue hit_things += L if((friendly_fire_check && caster && caster.faction_check_mob(L)) || L.stat == DEAD) continue From 897766e781ed7ddc57d16db645fccc47dcb7757d Mon Sep 17 00:00:00 2001 From: Seris02 <49109742+Seris02@users.noreply.github.com> Date: Sun, 29 Dec 2019 00:55:13 +0800 Subject: [PATCH 4/5] maybe fixes? --- .../mob/living/simple_animal/hostile/megafauna/hierophant.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm index bacd340958..7cfae9310a 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -596,7 +596,7 @@ Difficulty: Normal var/bursting = FALSE //if we're bursting and need to hit anyone crossing us var/list/nohurt -/obj/effect/temp_visual/hierophant/blast/Initialize(mapload, new_caster, friendly_fire, list/only_hit_once, list/donthurt) +/obj/effect/temp_visual/hierophant/blast/Initialize(mapload, new_caster, friendly_fire, list/only_hit_once, list/donthurt = null) . = ..() if(only_hit_once) hit_things = only_hit_once From 4fb549631fe92f749e8875efda51cdd47c84eab9 Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Sat, 28 Dec 2019 19:12:10 +0100 Subject: [PATCH 5/5] Don't use named arguments on new, please. --- .../hostile/mining_mobs/elites/pandora.dm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm index a76d9ed216..e65c4f5b20 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm @@ -115,7 +115,7 @@ /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/singular_shot_line(var/procsleft, var/angleused, var/turf/T) if(procsleft <= 0) return - new /obj/effect/temp_visual/hierophant/blast/pandora(T, src, donthurt = list(owner)) + new /obj/effect/temp_visual/hierophant/blast/pandora(T, src, null, null, list(owner)) T = get_step(T, angleused) procsleft = procsleft - 1 addtimer(CALLBACK(src, .proc/singular_shot_line, procsleft, angleused, T), 2) @@ -125,7 +125,7 @@ var/turf/T = get_turf(target) for(var/t in spiral_range_turfs(3, T)) if(get_dist(t, T) > 1) - new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, donthurt = list(owner)) + new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, null, null, list(owner)) /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/pandora_teleport(target) ranged_cooldown = world.time + cooldown_time @@ -140,9 +140,9 @@ new /obj/effect/temp_visual/hierophant/telegraph/teleport(T, src) new /obj/effect/temp_visual/hierophant/telegraph/teleport(source, src) for(var/t in RANGE_TURFS(1, T)) - new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, donthurt = list(owner)) + new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, null, null, list(owner)) for(var/t in RANGE_TURFS(1, source)) - new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, donthurt = list(owner)) + new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, null, null, list(owner)) animate(src, alpha = 0, time = 2, easing = EASE_OUT) //fade out visible_message("[src] fades out!") density = FALSE @@ -157,7 +157,7 @@ /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/aoe_squares(target) ranged_cooldown = world.time + cooldown_time var/turf/T = get_turf(target) - new /obj/effect/temp_visual/hierophant/blast/pandora(T, src, donthurt = list(owner)) + new /obj/effect/temp_visual/hierophant/blast/pandora(T, src, null, null, list(owner)) var/max_size = 2 addtimer(CALLBACK(src, .proc/aoe_squares_2, T, 0, max_size), 2) @@ -166,7 +166,7 @@ return for(var/t in spiral_range_turfs(ring, T)) if(get_dist(t, T) == ring) - new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, donthurt = list(owner)) + new /obj/effect/temp_visual/hierophant/blast/pandora(t, src, null, null, list(owner)) addtimer(CALLBACK(src, .proc/aoe_squares_2, T, (ring + 1), max_size), 2) //The specific version of hiero's squares pandora uses