diff --git a/code/game/objects/effects/temporary_visuals/temporary_visual.dm b/code/game/objects/effects/temporary_visuals/temporary_visual.dm index bb6cca92644..181977651fe 100644 --- a/code/game/objects/effects/temporary_visuals/temporary_visual.dm +++ b/code/game/objects/effects/temporary_visuals/temporary_visual.dm @@ -5,12 +5,16 @@ mouse_opacity = MOUSE_OPACITY_TRANSPARENT var/duration = 10 var/randomdir = TRUE + var/timerid /obj/effect/temp_visual/New() 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 diff --git a/code/game/turfs/simulated/floor/asteroid.dm b/code/game/turfs/simulated/floor/asteroid.dm index eea631a7a0e..e1a122609c5 100644 --- a/code/game/turfs/simulated/floor/asteroid.dm +++ b/code/game/turfs/simulated/floor/asteroid.dm @@ -159,9 +159,6 @@ data_having_type = /turf/simulated/floor/plating/asteroid/airless/cave/volcanic/has_data turf_type = /turf/simulated/floor/plating/asteroid/basalt/lava_land_surface - oxygen = 14 - nitrogen = 23 - temperature = 300 /turf/simulated/floor/plating/asteroid/airless/cave/volcanic/has_data //subtype for producing a tunnel with given data has_data = TRUE 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 f9cabef1431..eea5dcc3f84 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) + 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,48 +74,65 @@ icon_state = icon_aggro return -/obj/effect/goliath_tentacle +/obj/effect/temp_visual/goliath_tentacle name = "Goliath tentacle" - icon = 'icons/mob/animal.dmi' - icon_state = "Goliath_tentacle" - var/latched = 0 + icon = 'icons/mob/lavaland/lavaland_monsters.dmi' + icon_state = "Goliath_tentacle_spawn" + layer = BELOW_MOB_LAYER + var/mob/living/spawner -/obj/effect/goliath_tentacle/New() - var/turftype = get_turf(src) - if(istype(turftype, /turf/simulated/mineral)) - var/turf/simulated/mineral/M = turftype +/obj/effect/temp_visual/goliath_tentacle/New(var/loc, mob/living/new_spawner) + . = ..() + 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() - spawn(20) - Trip() + deltimer(timerid) + timerid = addtimer(CALLBACK(src, .proc/tripanim), 7, TIMER_STOPPABLE) -/obj/effect/goliath_tentacle/original - -/obj/effect/goliath_tentacle/original/New() - for(var/obj/effect/goliath_tentacle/original/O in loc)//No more GG NO RE from 2+ goliaths simultaneously tentacling you - if(O != src) - qdel(src) +/obj/effect/temp_visual/goliath_tentacle/original/New(var/loc, mob/living/new_spawner) + . = ..() var/list/directions = cardinal.Copy() - var/counter - for(counter = 1, counter <= 3, counter++) - var/spawndir = pick(directions) - directions -= spawndir - var/turf/T = get_step(src,spawndir) - new /obj/effect/goliath_tentacle(T) - ..() + 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/temp_visual/goliath_tentacle(T, new_spawner) + icon_state = "Goliath_tentacle_wiggle" + deltimer(timerid) + timerid = addtimer(CALLBACK(src, .proc/trip), 3, TIMER_STOPPABLE) -/obj/effect/goliath_tentacle/proc/Trip() - for(var/mob/living/M in src.loc) - M.Stun(5) - M.adjustBruteLoss(rand(10,15)) - latched = 1 - if(src && M) - visible_message("The [src.name] grabs hold of [M.name]!") +/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/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) + continue + visible_message("[src] grabs hold of [L]!") + L.Stun(5) + L.adjustBruteLoss(rand(10,15)) + latched = TRUE if(!latched) - qdel(src) + retract() else - spawn(50) - qdel(src) + deltimer(timerid) + timerid = addtimer(CALLBACK(src, .proc/retract), 10, TIMER_STOPPABLE) + +/obj/effect/temp_visual/goliath_tentacle/proc/retract() + icon_state = "Goliath_tentacle_retract" + deltimer(timerid) + timerid = QDEL_IN(src, 7) /obj/item/asteroid/goliath_hide name = "goliath hide plates" diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ee04e624f02..d5acf7dc03e 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1341,3 +1341,26 @@ var/list/slot_equipment_priority = list( \ /mob/proc/is_literate() return FALSE + +/mob/proc/faction_check_mob(mob/target, exact_match) + if(exact_match) //if we need an exact match, we need to do some bullfuckery. + var/list/faction_src = faction.Copy() + var/list/faction_target = target.faction.Copy() + if(!("\ref[src]" in faction_target)) //if they don't have our ref faction, remove it from our factions list. + faction_src -= "\ref[src]" //if we don't do this, we'll never have an exact match. + if(!("\ref[target]" in faction_src)) + faction_target -= "\ref[target]" //same thing here. + return faction_check(faction_src, faction_target, TRUE) + return faction_check(faction, target.faction, FALSE) + +/proc/faction_check(list/faction_A, list/faction_B, exact_match) + var/list/match_list + if(exact_match) + match_list = faction_A&faction_B //only items in both lists + var/length = LAZYLEN(match_list) + if(length) + return (length == LAZYLEN(faction_A)) //if they're not the same len(gth) or we don't have a len, then this isn't an exact match. + else + match_list = faction_A&faction_B + return LAZYLEN(match_list) + return FALSE \ No newline at end of file diff --git a/icons/mob/lavaland/lavaland_monsters.dmi b/icons/mob/lavaland/lavaland_monsters.dmi index 8cf32385df3..27f09173518 100644 Binary files a/icons/mob/lavaland/lavaland_monsters.dmi and b/icons/mob/lavaland/lavaland_monsters.dmi differ