Merge pull request #10323 from Seris02/pandorafix
probably fixes pandoras attacking their owners
This commit is contained in:
@@ -594,12 +594,15 @@ 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 = null)
|
||||
. = ..()
|
||||
if(only_hit_once)
|
||||
hit_things = only_hit_once
|
||||
friendly_fire_check = friendly_fire
|
||||
if(donthurt)
|
||||
hit_things += donthurt
|
||||
if(new_caster)
|
||||
hit_things += new_caster
|
||||
if(ismineralturf(loc)) //drill mineral turfs
|
||||
|
||||
@@ -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("<span class='boldwarning'>[mychild] suddenly reappears above [src]!</span>")
|
||||
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("<span class='boldwarning'>[src] begins to convulse violently before beginning to dissipate.</span>")
|
||||
@@ -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, "<span class='boldwarning'>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.</span>")
|
||||
to_chat(mychild, "<b>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!</b>")
|
||||
to_chat(mychild, "<span class='big bold'>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!</span>")
|
||||
|
||||
|
||||
/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, "<span class='info'>[src] only works on the corpse of a sentient lavaland elite.</span>")
|
||||
|
||||
|
||||
/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)
|
||||
|
||||
@@ -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 = "<span class='boldwarning'>You are now creating a single linear magic square.</span>"
|
||||
chosen_attack_num = SINGULAR_SHOT
|
||||
|
||||
|
||||
/datum/action/innate/elite_attack/magic_box
|
||||
name = "Magic Box"
|
||||
button_icon_state = "magic_box"
|
||||
chosen_message = "<span class='boldwarning'>You are now attacking with a box of magic squares.</span>"
|
||||
chosen_attack_num = MAGIC_BOX
|
||||
|
||||
|
||||
/datum/action/innate/elite_attack/pandora_teleport
|
||||
name = "Line Teleport"
|
||||
button_icon_state = "pandora_teleport"
|
||||
chosen_message = "<span class='boldwarning'>You will now teleport to your target.</span>"
|
||||
chosen_attack_num = PANDORA_TELEPORT
|
||||
|
||||
|
||||
/datum/action/innate/elite_attack/aoe_squares
|
||||
name = "AOE Blast"
|
||||
button_icon_state = "aoe_squares"
|
||||
chosen_message = "<span class='boldwarning'>Your attacks will spawn an AOE blast at your target location.</span>"
|
||||
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, null, null, 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, null, null, 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, null, null, 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, null, null, list(owner))
|
||||
animate(src, alpha = 0, time = 2, easing = EASE_OUT) //fade out
|
||||
visible_message("<span class='hierophant_warning'>[src] fades out!</span>")
|
||||
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("<span class='hierophant_warning'>[src] fades in!</span>")
|
||||
|
||||
|
||||
/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, null, null, 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, 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
|
||||
/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)
|
||||
|
||||
Reference in New Issue
Block a user