From 4c40df089505c5cb9c35dcd70398f606f799f57f Mon Sep 17 00:00:00 2001 From: Mark van Alphen Date: Sun, 2 Jun 2019 05:03:38 +0200 Subject: [PATCH] Goliath code update --- .../temporary_visuals/temporary_visual.dm | 19 +++- .../simple_animal/hostile/mining/basilisk.dm | 1 - .../simple_animal/hostile/mining/goliath.dm | 103 +++++++++++++----- .../simple_animal/hostile/mining/hivelord.dm | 1 - .../simple_animal/hostile/mining/mining.dm | 1 + .../hostile/mining/necropolis_tendril.dm | 2 +- 6 files changed, 89 insertions(+), 38 deletions(-) diff --git a/code/game/objects/effects/temporary_visuals/temporary_visual.dm b/code/game/objects/effects/temporary_visuals/temporary_visual.dm index bb6cca92644..23b1aaa0d2e 100644 --- a/code/game/objects/effects/temporary_visuals/temporary_visual.dm +++ b/code/game/objects/effects/temporary_visuals/temporary_visual.dm @@ -1,16 +1,23 @@ //temporary visual effects /obj/effect/temp_visual - anchored = 1 + icon_state = "nothing" + anchored = TRUE layer = ABOVE_MOB_LAYER mouse_opacity = MOUSE_OPACITY_TRANSPARENT - var/duration = 10 + var/duration = 10 //in deciseconds var/randomdir = TRUE + var/timerid -/obj/effect/temp_visual/New() +/obj/effect/temp_visual/Initialize(mapload) + . = ..() if(randomdir) setDir(pick(cardinal)) - QDEL_IN(src, duration) + timerid = QDEL_IN(src, duration) + +/obj/effect/temp_visual/Destroy() + . = ..() + deltimer(timerid) /obj/effect/temp_visual/singularity_act() return @@ -24,7 +31,7 @@ /obj/effect/temp_visual/dir_setting randomdir = FALSE -/obj/effect/temp_visual/dir_setting/New(loc, set_dir) +/obj/effect/temp_visual/dir_setting/Initialize(mapload, set_dir) if(set_dir) setDir(set_dir) - ..() \ No newline at end of file + . = ..() diff --git a/code/modules/mob/living/simple_animal/hostile/mining/basilisk.dm b/code/modules/mob/living/simple_animal/hostile/mining/basilisk.dm index a947cace8e2..28aacd37a73 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/basilisk.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/basilisk.dm @@ -77,7 +77,6 @@ stat_attack = 1 flying = TRUE robust_searching = 1 - var/fromtendril = FALSE loot = list() butcher_results = list(/obj/item/stack/ore/diamond = 2, /obj/item/stack/sheet/sinew = 2, /obj/item/stack/sheet/bone = 1) diff --git a/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm b/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm index 391bc4ce67d..71a25d4b79a 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/goliath.dm @@ -56,7 +56,7 @@ var/tturf = get_turf(target) if(get_dist(src, target) <= 7)//Screen range check, so you can't get tentacle'd offscreen visible_message("The [src.name] digs its tentacles under [target.name]!") - new /obj/effect/goliath_tentacle/original(tturf, src) + new /obj/effect/temp_visual/goliath_tentacle/original(tturf, src) ranged_cooldown = world.time + ranged_cooldown_time icon_state = icon_aggro pre_attack = 0 @@ -74,44 +74,104 @@ icon_state = icon_aggro return -/obj/effect/goliath_tentacle - name = "Goliath tentacle" +// Lavaland Goliath +/mob/living/simple_animal/hostile/asteroid/goliath/beast + name = "goliath" + desc = "A hulking, armor-plated beast with long tendrils arching from its back." + icon = 'icons/mob/lavaland/lavaland_monsters.dmi' + icon_state = "goliath" + icon_living = "goliath" + icon_aggro = "goliath" + icon_dead = "goliath_dead" + throw_message = "does nothing to the tough hide of the" + pre_attack_icon = "goliath2" + butcher_results = list(/obj/item/reagent_containers/food/snacks/goliath = 2, /obj/item/stack/sheet/animalhide/goliath_hide = 1, /obj/item/stack/sheet/bone = 2) + loot = list() + stat_attack = 1 + robust_searching = 1 + +/mob/living/simple_animal/hostile/asteroid/goliath/beast/random/Initialize() + . = ..() + if(prob(1)) + new /mob/living/simple_animal/hostile/asteroid/goliath/beast/ancient(loc) + return INITIALIZE_HINT_QDEL + +/mob/living/simple_animal/hostile/asteroid/goliath/beast/ancient + name = "ancient goliath" + desc = "Goliaths are biologically immortal, and rare specimens have survived for centuries. This one is clearly ancient, and its tentacles constantly churn the earth around it." + icon_state = "Goliath" + icon_living = "Goliath" + icon_aggro = "Goliath_alert" + icon_dead = "Goliath_dead" + maxHealth = 400 + health = 400 + speed = 4 + pre_attack_icon = "Goliath_preattack" + throw_message = "does nothing to the rocky hide of the" + loot = list(/obj/item/stack/sheet/animalhide/goliath_hide) //A throwback to the asteroid days + butcher_results = list(/obj/item/reagent_containers/food/snacks/goliath = 2, /obj/item/stack/sheet/bone = 2) + wander = FALSE + var/list/cached_tentacle_turfs + var/turf/last_location + var/tentacle_recheck_cooldown = 100 + +/mob/living/simple_animal/hostile/asteroid/goliath/beast/ancient/Life() + . = ..() + if(!.) // dead + return + if(isturf(loc)) + if(!LAZYLEN(cached_tentacle_turfs) || loc != last_location || tentacle_recheck_cooldown <= world.time) + LAZYCLEARLIST(cached_tentacle_turfs) + last_location = loc + tentacle_recheck_cooldown = world.time + initial(tentacle_recheck_cooldown) + for(var/turf/simulated/floor/T in orange(4, loc)) + LAZYADD(cached_tentacle_turfs, T) + for(var/t in cached_tentacle_turfs) + if(isfloorturf(t)) + if(prob(10)) + new /obj/effect/temp_visual/goliath_tentacle(t, src) + else + cached_tentacle_turfs -= t + +/mob/living/simple_animal/hostile/asteroid/goliath/beast/tendril + fromtendril = TRUE + +//tentacles +/obj/effect/temp_visual/goliath_tentacle + name = "goliath tentacle" icon = 'icons/mob/lavaland/lavaland_monsters.dmi' icon_state = "Goliath_tentacle_spawn" layer = BELOW_MOB_LAYER var/mob/living/spawner - var/timerid -/obj/effect/goliath_tentacle/New(var/loc, mob/living/new_spawner) +/obj/effect/temp_visual/goliath_tentacle/Initialize(mapload, mob/living/new_spawner) . = ..() - for(var/obj/effect/goliath_tentacle/T in loc) + for(var/obj/effect/temp_visual/goliath_tentacle/T in loc) if(T != src) return INITIALIZE_HINT_QDEL - if(!QDELETED(new_spawner)) spawner = new_spawner - if(ismineralturf(loc)) var/turf/simulated/mineral/M = loc M.gets_drilled() deltimer(timerid) timerid = addtimer(CALLBACK(src, .proc/tripanim), 7, TIMER_STOPPABLE) -/obj/effect/goliath_tentacle/original/New(var/loc, mob/living/new_spawner) +/obj/effect/temp_visual/goliath_tentacle/original/Initialize(mapload, new_spawner) . = ..() var/list/directions = cardinal.Copy() for(var/i in 1 to 3) var/spawndir = pick_n_take(directions) var/turf/T = get_step(src, spawndir) if(T) - new /obj/effect/goliath_tentacle(T, spawner) + new /obj/effect/temp_visual/goliath_tentacle(T, spawner) -/obj/effect/goliath_tentacle/proc/tripanim() +/obj/effect/temp_visual/goliath_tentacle/proc/tripanim() icon_state = "Goliath_tentacle_wiggle" deltimer(timerid) timerid = addtimer(CALLBACK(src, .proc/trip), 3, TIMER_STOPPABLE) -/obj/effect/goliath_tentacle/proc/trip() +/obj/effect/temp_visual/goliath_tentacle/proc/trip() var/latched = FALSE for(var/mob/living/L in loc) if((!QDELETED(spawner) && spawner.faction_check_mob(L)) || L.stat == DEAD) @@ -126,22 +186,7 @@ deltimer(timerid) timerid = addtimer(CALLBACK(src, .proc/retract), 10, TIMER_STOPPABLE) -/obj/effect/goliath_tentacle/proc/retract() +/obj/effect/temp_visual/goliath_tentacle/proc/retract() icon_state = "Goliath_tentacle_retract" deltimer(timerid) - timerid = QDEL_IN(src, 7) - -/mob/living/simple_animal/hostile/asteroid/goliath/beast - name = "goliath" - desc = "A hulking, armor-plated beast with long tendrils arching from its back." - icon = 'icons/mob/lavaland/lavaland_monsters.dmi' - icon_state = "goliath" - icon_living = "goliath" - icon_aggro = "goliath" - icon_dead = "goliath_dead" - throw_message = "does nothing to the tough hide of the" - pre_attack_icon = "goliath2" - butcher_results = list(/obj/item/reagent_containers/food/snacks/goliath = 2, /obj/item/stack/sheet/animalhide/goliath_hide = 1, /obj/item/stack/sheet/bone = 2) - loot = list() - stat_attack = 1 - robust_searching = 1 \ No newline at end of file + timerid = QDEL_IN(src, 5) diff --git a/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm b/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm index 51b8e0c9842..60c1f5e08e7 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/hivelord.dm @@ -236,7 +236,6 @@ del_on_death = 1 stat_attack = 1 robust_searching = 1 - var/fromtendril = FALSE var/dwarf_mob = FALSE var/mob/living/carbon/human/stored_mob diff --git a/code/modules/mob/living/simple_animal/hostile/mining/mining.dm b/code/modules/mob/living/simple_animal/hostile/mining/mining.dm index 2fd5e6ef0f2..e23624a5a9d 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/mining.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/mining.dm @@ -15,6 +15,7 @@ a_intent = INTENT_HARM var/throw_message = "bounces off of" var/icon_aggro = null // for swapping to when we get aggressive + var/fromtendril = FALSE see_in_dark = 8 see_invisible = SEE_INVISIBLE_MINIMUM mob_size = MOB_SIZE_LARGE diff --git a/code/modules/mob/living/simple_animal/hostile/mining/necropolis_tendril.dm b/code/modules/mob/living/simple_animal/hostile/mining/necropolis_tendril.dm index e8dfa093918..2ee9c387140 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining/necropolis_tendril.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining/necropolis_tendril.dm @@ -73,7 +73,7 @@ qdel(src) /mob/living/simple_animal/hostile/spawner/lavaland/goliath - mob_type = /mob/living/simple_animal/hostile/asteroid/goliath/beast + mob_type = /mob/living/simple_animal/hostile/asteroid/goliath/beast/tendril /mob/living/simple_animal/hostile/spawner/lavaland/legion mob_type = /mob/living/simple_animal/hostile/asteroid/hivelord/legion/tendril \ No newline at end of file