mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-20 11:35:19 +01:00
Sideports a couple of init unit tests from Neb.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
create_reagents(100)
|
||||
|
||||
/obj/effect/decal/cleanable/chemcoating/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
for(var/obj/O in get_turf(src))
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
/obj/effect/decal/warning_stripes
|
||||
icon = 'icons/effects/warning_stripes.dmi'
|
||||
|
||||
/obj/effect/decal/warning_stripes/New()
|
||||
/obj/effect/decal/warning_stripes/Initialize()
|
||||
. = ..()
|
||||
var/turf/T=get_turf(src)
|
||||
var/image/I=image(icon, icon_state = icon_state, dir = dir)
|
||||
I.color=color
|
||||
T.overlays += I
|
||||
qdel(src)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
@@ -10,32 +10,37 @@
|
||||
var/obj/item/weapon/mine/mineitemtype = /obj/item/weapon/mine
|
||||
var/panel_open = 0
|
||||
var/datum/wires/mines/wires = null
|
||||
register_as_dangerous_object = TRUE
|
||||
|
||||
var/camo_net = FALSE // Will the mine 'cloak' on deployment?
|
||||
|
||||
// The trap item will be triggered in some manner when detonating. Default only checks for grenades.
|
||||
var/obj/item/trap = null
|
||||
|
||||
/obj/effect/mine/New()
|
||||
/obj/effect/mine/Initialize()
|
||||
icon_state = "uglyminearmed"
|
||||
wires = new(src)
|
||||
|
||||
. = ..()
|
||||
if(ispath(trap))
|
||||
trap = new trap(src)
|
||||
|
||||
/obj/effect/mine/Initialize()
|
||||
..()
|
||||
|
||||
register_dangerous_to_step()
|
||||
if(camo_net)
|
||||
alpha = 50
|
||||
|
||||
/obj/effect/mine/Destroy()
|
||||
unregister_dangerous_to_step()
|
||||
if(trap)
|
||||
QDEL_NULL(trap)
|
||||
qdel_null(wires)
|
||||
return ..()
|
||||
|
||||
/obj/effect/mine/Moved(atom/oldloc)
|
||||
. = ..()
|
||||
if(.)
|
||||
var/turf/old_turf = get_turf(oldloc)
|
||||
var/turf/new_turf = get_turf(src)
|
||||
if(old_turf != new_turf)
|
||||
old_turf.unregister_dangerous_object(src)
|
||||
new_turf.register_dangerous_object(src)
|
||||
|
||||
/obj/effect/mine/proc/explode(var/mob/living/M)
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread()
|
||||
triggered = 1
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
..()
|
||||
|
||||
/obj/effect/temporary_effect/eruption/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
flick("[icon_state]_create",src)
|
||||
|
||||
/obj/effect/temporary_effect/eruption/Destroy()
|
||||
|
||||
@@ -159,7 +159,6 @@
|
||||
|
||||
/obj/effect/spawner/newbomb/Initialize(newloc)
|
||||
..(newloc)
|
||||
|
||||
var/obj/item/device/transfer_valve/V = new(src.loc)
|
||||
var/obj/item/weapon/tank/phoron/PT = new(V)
|
||||
var/obj/item/weapon/tank/oxygen/OT = new(V)
|
||||
@@ -183,19 +182,14 @@
|
||||
OT.air_contents.temperature = PHORON_MINIMUM_BURN_TEMPERATURE+1
|
||||
OT.air_contents.update_values()
|
||||
|
||||
|
||||
var/obj/item/device/assembly/S = new assembly_type(V)
|
||||
|
||||
|
||||
V.attached_device = S
|
||||
|
||||
S.holder = V
|
||||
S.toggle_secure()
|
||||
|
||||
V.update_icon()
|
||||
|
||||
qdel(src)
|
||||
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
|
||||
///////////////////////
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
var/cell_type = /obj/item/weapon/cell/device
|
||||
|
||||
/obj/item/device/flash/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
power_supply = new cell_type(src)
|
||||
|
||||
/obj/item/device/flash/attackby(var/obj/item/W, var/mob/user)
|
||||
|
||||
@@ -7,15 +7,12 @@
|
||||
var/obj/item/stack/type_to_spawn = null
|
||||
|
||||
/obj/fiftyspawner/Initialize()
|
||||
..() //We're not returning . because we're going to ask to be deleted.
|
||||
|
||||
..()
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/item/stack/M = new type_to_spawn(T)
|
||||
var/obj/structure/closet/C = locate() in T
|
||||
var/obj/item/stack/M = new type_to_spawn(C || T)
|
||||
M.amount = M.max_amount //some stuff spawns with 60, we're still calling it fifty
|
||||
M.update_icon() // Some stacks have different sprites depending on how full they are.
|
||||
var/obj/structure/closet/C = locate() in T
|
||||
if(C)
|
||||
C.contents += M
|
||||
return INITIALIZE_HINT_QDEL //Bye!
|
||||
|
||||
/obj/fiftyspawner/rods
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
stacktype = /obj/item/stack/rods
|
||||
no_variants = TRUE
|
||||
|
||||
/obj/item/stack/rods/New()
|
||||
..()
|
||||
/obj/item/stack/rods/Initialize()
|
||||
. = ..()
|
||||
recipes = rods_recipes
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -32,19 +32,15 @@
|
||||
|
||||
bag_material = MAT_SYNCLOTH
|
||||
|
||||
/obj/item/stack/sandbags/New(var/newloc, var/amt, var/bag_mat)
|
||||
..()
|
||||
/obj/item/stack/sandbags/Initialize(var/ml, var/amt, var/bag_mat)
|
||||
. = ..(ml, amt)
|
||||
recipes = sandbag_recipes
|
||||
update_icon()
|
||||
|
||||
if(bag_mat)
|
||||
bag_material = bag_mat
|
||||
|
||||
var/datum/material/M = get_material_by_name("[bag_material]")
|
||||
if(!M)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
return INITIALIZE_HINT_QDEL
|
||||
color = M.icon_colour
|
||||
|
||||
/obj/item/stack/sandbags/update_icon()
|
||||
@@ -136,17 +132,13 @@ var/global/list/datum/stack_recipe/sandbag_recipes = list( \
|
||||
|
||||
var/bag_material = "cloth"
|
||||
|
||||
/obj/item/stack/emptysandbag/New(var/newloc, var/amt, var/bag_mat)
|
||||
..(newloc, amt)
|
||||
|
||||
/obj/item/stack/emptysandbag/Initialize(var/ml, var/amt, var/bag_mat)
|
||||
. = ..(ml, amt)
|
||||
if(bag_mat)
|
||||
bag_material = bag_mat
|
||||
|
||||
var/datum/material/M = get_material_by_name("[bag_material]")
|
||||
if(!M)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
return INITIALIZE_HINT_QDEL
|
||||
color = M.icon_colour
|
||||
|
||||
/obj/item/stack/emptysandbag/attack_self(var/mob/user)
|
||||
|
||||
@@ -29,14 +29,13 @@
|
||||
var/pass_color = FALSE // Will the item pass its own color var to the created item? Dyed cloth, wood, etc.
|
||||
var/strict_color_stacking = FALSE // Will the stack merge with other stacks that are different colors? (Dyed cloth, wood, etc)
|
||||
|
||||
/obj/item/stack/New(var/loc, var/amount=null)
|
||||
..()
|
||||
if (!stacktype)
|
||||
/obj/item/stack/Initialize(var/ml, var/amount)
|
||||
. = ..()
|
||||
if(!stacktype)
|
||||
stacktype = type
|
||||
if (amount)
|
||||
if(amount)
|
||||
src.amount = amount
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/stack/Destroy()
|
||||
if(uses_charge)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
w_class = ITEMSIZE_TINY
|
||||
max_amount = 30
|
||||
|
||||
/obj/item/stack/arcadeticket/New(loc, amount = null)
|
||||
/obj/item/stack/arcadeticket/Initialize()
|
||||
. = ..()
|
||||
update_icon()
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
drop_sound = 'sound/items/drop/axe.ogg'
|
||||
pickup_sound = 'sound/items/pickup/axe.ogg'
|
||||
|
||||
/obj/item/stack/tile/New()
|
||||
..()
|
||||
/obj/item/stack/tile/Initialize()
|
||||
. = ..()
|
||||
randpixel_xy()
|
||||
|
||||
/*
|
||||
|
||||
@@ -77,14 +77,14 @@
|
||||
//visible_message("[user] has smashed the snowball in their hand!", "You smash the snowball in your hand.")
|
||||
to_chat(user, "<span class='notice'>You smash the snowball in your hand.</span>")
|
||||
var/atom/S = new /obj/item/stack/material/snow(user.loc)
|
||||
del(src)
|
||||
qdel(src)
|
||||
user.put_in_hands(S)
|
||||
else
|
||||
//visible_message("[user] starts compacting the snowball.", "You start compacting the snowball.")
|
||||
to_chat(user, "<span class='notice'>You start compacting the snowball.</span>")
|
||||
if(do_after(user, 2 SECONDS))
|
||||
var/atom/S = new /obj/item/weapon/material/snow/snowball/reinforced(user.loc)
|
||||
del(src)
|
||||
qdel(src)
|
||||
user.put_in_hands(S)
|
||||
|
||||
/obj/item/weapon/material/snow/snowball/reinforced
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
gauge_icon = "indicator_emergency"
|
||||
|
||||
/obj/item/weapon/tank/emergency/nitrogen/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
src.air_contents.adjust_gas("nitrogen", (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
||||
|
||||
/obj/item/weapon/tank/emergency/nitrogen/double
|
||||
|
||||
@@ -671,7 +671,7 @@
|
||||
always_process = TRUE
|
||||
|
||||
/obj/item/weapon/weldingtool/electric/mounted/exosuit/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
if(istype(loc, /obj/item/mecha_parts/mecha_equipment))
|
||||
equip_mount = loc
|
||||
|
||||
@@ -19,19 +19,12 @@
|
||||
var/can_speak = 0 //For MMIs and admin trickery. If an object has a brainmob in its contents, set this to 1 to allow it to speak.
|
||||
|
||||
var/show_examine = TRUE // Does this pop up on a mob when the mob is examined?
|
||||
var/register_as_dangerous_object = FALSE // Should this tell its turf that it is dangerous automatically?
|
||||
|
||||
/obj/Initialize()
|
||||
if(register_as_dangerous_object)
|
||||
register_dangerous_to_step()
|
||||
return ..()
|
||||
|
||||
/obj/Destroy()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
if(register_as_dangerous_object)
|
||||
unregister_dangerous_to_step()
|
||||
return ..()
|
||||
|
||||
<<<<<<< HEAD
|
||||
/obj/Moved(atom/oldloc)
|
||||
. = ..()
|
||||
if(register_as_dangerous_object)
|
||||
@@ -43,6 +36,9 @@
|
||||
new_turf.register_dangerous_object(src)
|
||||
|
||||
/obj/Topic(href, href_list, var/datum/tgui_state/state = GLOB.tgui_default_state)
|
||||
=======
|
||||
/obj/Topic(href, href_list, var/datum/topic_state/state = default_state)
|
||||
>>>>>>> b22a056... Sideports a couple of init unit tests from Neb. (#7893)
|
||||
if(usr && ..())
|
||||
return 1
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
// creates a new object and deletes itself
|
||||
/obj/random/Initialize()
|
||||
. = ..()
|
||||
..()
|
||||
if (!prob(spawn_nothing_percentage))
|
||||
spawn_item()
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<<<<<<< HEAD
|
||||
GLOBAL_LIST_EMPTY(cliff_icon_cache)
|
||||
|
||||
/*
|
||||
@@ -234,3 +235,257 @@ two tiles on initialization, and which way a cliff is facing may change during m
|
||||
if(should_fall(L))
|
||||
return FALSE
|
||||
return ..()
|
||||
=======
|
||||
GLOBAL_LIST_EMPTY(cliff_icon_cache)
|
||||
|
||||
/*
|
||||
Cliffs give a visual illusion of depth by seperating two places while presenting a 'top' and 'bottom' side.
|
||||
|
||||
Mobs moving into a cliff from the bottom side will simply bump into it and be denied moving into the tile,
|
||||
where as mobs moving into a cliff from the top side will 'fall' off the cliff, forcing them to the bottom, causing significant damage and stunning them.
|
||||
|
||||
Mobs can climb this while wearing climbing equipment by clickdragging themselves onto a cliff, as if it were a table.
|
||||
|
||||
Flying mobs can pass over all cliffs with no risk of falling.
|
||||
|
||||
Projectiles and thrown objects can pass, however if moving upwards, there is a chance for it to be stopped by the cliff.
|
||||
This makes fighting something that is on top of a cliff more challenging.
|
||||
|
||||
As a note, dir points upwards, e.g. pointing WEST means the left side is 'up', and the right side is 'down'.
|
||||
|
||||
When mapping these in, be sure to give at least a one tile clearance, as NORTH facing cliffs expand to
|
||||
two tiles on initialization, and which way a cliff is facing may change during maploading.
|
||||
*/
|
||||
|
||||
/obj/structure/cliff
|
||||
name = "cliff"
|
||||
desc = "A steep rock ledge. You might be able to climb it if you feel bold enough."
|
||||
description_info = "Walking off the edge of a cliff while on top will cause you to fall off, causing severe injury.<br>\
|
||||
You can climb this cliff if wearing special climbing equipment, by click-dragging yourself onto the cliff.<br>\
|
||||
Projectiles traveling up a cliff may hit the cliff instead, making it more difficult to fight something \
|
||||
on top."
|
||||
icon = 'icons/obj/flora/rocks.dmi'
|
||||
|
||||
anchored = TRUE
|
||||
density = TRUE
|
||||
opacity = FALSE
|
||||
climbable = TRUE
|
||||
climb_delay = 10 SECONDS
|
||||
block_turf_edges = TRUE // Don't want turf edges popping up from the cliff edge.
|
||||
|
||||
var/icon_variant = null // Used to make cliffs less repeative by having a selection of sprites to display.
|
||||
var/corner = FALSE // Used for icon things.
|
||||
var/ramp = FALSE // Ditto.
|
||||
var/bottom = FALSE // Used for 'bottom' typed cliffs, to avoid infinite cliffs, and for icons.
|
||||
|
||||
var/is_double_cliff = FALSE // Set to true when making the two-tile cliffs, used for projectile checks.
|
||||
var/uphill_penalty = 30 // Odds of a projectile not making it up the cliff.
|
||||
|
||||
/obj/structure/cliff/Initialize()
|
||||
. = ..()
|
||||
register_dangerous_to_step()
|
||||
|
||||
/obj/structure/cliff/Destroy()
|
||||
unregister_dangerous_to_step()
|
||||
. = ..()
|
||||
|
||||
/obj/structure/cliff/Moved(atom/oldloc)
|
||||
. = ..()
|
||||
if(.)
|
||||
var/turf/old_turf = get_turf(oldloc)
|
||||
var/turf/new_turf = get_turf(src)
|
||||
if(old_turf != new_turf)
|
||||
old_turf.unregister_dangerous_object(src)
|
||||
new_turf.register_dangerous_object(src)
|
||||
|
||||
// These arrange their sprites at runtime, as opposed to being statically placed in the map file.
|
||||
/obj/structure/cliff/automatic
|
||||
icon_state = "cliffbuilder"
|
||||
dir = NORTH
|
||||
|
||||
/obj/structure/cliff/automatic/corner
|
||||
icon_state = "cliffbuilder-corner"
|
||||
dir = NORTHEAST
|
||||
corner = TRUE
|
||||
|
||||
// Tiny part that doesn't block, used for making 'ramps'.
|
||||
/obj/structure/cliff/automatic/ramp
|
||||
icon_state = "cliffbuilder-ramp"
|
||||
dir = NORTHEAST
|
||||
density = FALSE
|
||||
ramp = TRUE
|
||||
|
||||
// Made automatically as needed by automatic cliffs.
|
||||
/obj/structure/cliff/bottom
|
||||
bottom = TRUE
|
||||
|
||||
/obj/structure/cliff/automatic/Initialize()
|
||||
..()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
// Paranoid about the maploader, direction is very important to cliffs, since they may get bigger if initialized while facing NORTH.
|
||||
/obj/structure/cliff/automatic/LateInitialize()
|
||||
if(dir in GLOB.cardinal)
|
||||
icon_variant = pick("a", "b", "c")
|
||||
|
||||
if(dir & NORTH && !bottom) // North-facing cliffs require more cliffs to be made.
|
||||
make_bottom()
|
||||
|
||||
update_icon()
|
||||
|
||||
/obj/structure/cliff/proc/make_bottom()
|
||||
// First, make sure there's room to put the bottom side.
|
||||
var/turf/T = locate(x, y - 1, z)
|
||||
if(!istype(T))
|
||||
return FALSE
|
||||
|
||||
// Now make the bottom cliff have mostly the same variables.
|
||||
var/obj/structure/cliff/bottom/bottom = new(T)
|
||||
is_double_cliff = TRUE
|
||||
climb_delay /= 2 // Since there are two cliffs to climb when going north, both take half the time.
|
||||
|
||||
bottom.dir = dir
|
||||
bottom.is_double_cliff = TRUE
|
||||
bottom.climb_delay = climb_delay
|
||||
bottom.icon_variant = icon_variant
|
||||
bottom.corner = corner
|
||||
bottom.ramp = ramp
|
||||
bottom.layer = layer - 0.1
|
||||
bottom.density = density
|
||||
bottom.update_icon()
|
||||
|
||||
/obj/structure/cliff/set_dir(new_dir)
|
||||
..()
|
||||
update_icon()
|
||||
|
||||
/obj/structure/cliff/update_icon()
|
||||
icon_state = "cliff-[dir][icon_variant][bottom ? "-bottom" : ""][corner ? "-corner" : ""][ramp ? "-ramp" : ""]"
|
||||
|
||||
// Now for making the top-side look like a different turf.
|
||||
var/turf/T = get_step(src, dir)
|
||||
if(!istype(T))
|
||||
return
|
||||
|
||||
var/subtraction_icon_state = "[icon_state]-subtract"
|
||||
var/cache_string = "[icon_state]_[T.icon]_[T.icon_state]"
|
||||
if(T && subtraction_icon_state in cached_icon_states(icon))
|
||||
cut_overlays()
|
||||
// If we've made the same icon before, just recycle it.
|
||||
if(cache_string in GLOB.cliff_icon_cache)
|
||||
add_overlay(GLOB.cliff_icon_cache[cache_string])
|
||||
|
||||
else // Otherwise make a new one, but only once.
|
||||
var/icon/underlying_ground = icon(T.icon, T.icon_state, T.dir)
|
||||
var/icon/subtract = icon(icon, subtraction_icon_state)
|
||||
underlying_ground.Blend(subtract, ICON_SUBTRACT)
|
||||
var/image/final = image(underlying_ground)
|
||||
final.layer = src.layer - 0.2
|
||||
GLOB.cliff_icon_cache[cache_string] = final
|
||||
add_overlay(final)
|
||||
|
||||
|
||||
// Movement-related code.
|
||||
|
||||
/obj/structure/cliff/CanPass(atom/movable/mover, turf/target)
|
||||
if(isliving(mover))
|
||||
var/mob/living/L = mover
|
||||
if(L.hovering) // Flying mobs can always pass.
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
// Projectiles and objects flying 'upward' have a chance to hit the cliff instead, wasting the shot.
|
||||
else if(istype(mover, /obj))
|
||||
var/obj/O = mover
|
||||
if(check_shield_arc(src, dir, O)) // This is actually for mobs but it will work for our purposes as well.
|
||||
if(prob(uphill_penalty / (1 + is_double_cliff) )) // Firing upwards facing NORTH means it will likely have to pass through two cliffs, so the chance is halved.
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/cliff/Bumped(atom/A)
|
||||
if(isliving(A))
|
||||
var/mob/living/L = A
|
||||
if(should_fall(L))
|
||||
fall_off_cliff(L)
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/structure/cliff/proc/should_fall(mob/living/L)
|
||||
if(L.hovering)
|
||||
return FALSE
|
||||
|
||||
var/turf/T = get_turf(L)
|
||||
if(T && get_dir(T, loc) & reverse_dir[dir]) // dir points 'up' the cliff, e.g. cliff pointing NORTH will cause someone to fall if moving SOUTH into it.
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/structure/cliff/proc/fall_off_cliff(mob/living/L)
|
||||
if(!istype(L))
|
||||
return FALSE
|
||||
var/turf/T = get_step(src, reverse_dir[dir])
|
||||
var/displaced = FALSE
|
||||
|
||||
if(dir in list(EAST, WEST)) // Apply an offset if flying sideways, to help maintain the illusion of depth.
|
||||
for(var/i = 1 to 2)
|
||||
var/turf/new_T = locate(T.x, T.y - i, T.z)
|
||||
if(!new_T || locate(/obj/structure/cliff) in new_T)
|
||||
break
|
||||
T = new_T
|
||||
displaced = TRUE
|
||||
|
||||
if(istype(T))
|
||||
visible_message(span("danger", "\The [L] falls off \the [src]!"))
|
||||
L.forceMove(T)
|
||||
|
||||
// Do the actual hurting. Double cliffs do halved damage due to them most likely hitting twice.
|
||||
var/harm = !is_double_cliff ? 1 : 0.5
|
||||
if(istype(L.buckled, /obj/vehicle)) // People falling off in vehicles will take less damage, but will damage the vehicle severely.
|
||||
var/obj/vehicle/vehicle = L.buckled
|
||||
vehicle.adjust_health(40 * harm)
|
||||
to_chat(L, span("warning", "\The [vehicle] absorbs some of the impact, damaging it."))
|
||||
harm /= 2
|
||||
|
||||
playsound(L, 'sound/effects/break_stone.ogg', 70, 1)
|
||||
L.Weaken(5 * harm)
|
||||
var/fall_time = 3
|
||||
if(displaced) // Make the fall look more natural when falling sideways.
|
||||
L.pixel_z = 32 * 2
|
||||
animate(L, pixel_z = 0, time = fall_time)
|
||||
sleep(fall_time) // A brief delay inbetween the two sounds helps sell the 'ouch' effect.
|
||||
playsound(L, "punch", 70, 1)
|
||||
shake_camera(L, 1, 1)
|
||||
visible_message(span("danger", "\The [L] hits the ground!"))
|
||||
|
||||
// The bigger they are, the harder they fall.
|
||||
// They will take at least 20 damage at the minimum, and tries to scale up to 40% of their max health.
|
||||
// This scaling is capped at 100 total damage, which occurs if the thing that fell has more than 250 health.
|
||||
var/damage = between(20, L.getMaxHealth() * 0.4, 100)
|
||||
var/target_zone = ran_zone()
|
||||
var/blocked = L.run_armor_check(target_zone, "melee") * harm
|
||||
var/soaked = L.get_armor_soak(target_zone, "melee") * harm
|
||||
|
||||
L.apply_damage(damage * harm, BRUTE, target_zone, blocked, soaked, used_weapon=src)
|
||||
|
||||
// Now fall off more cliffs below this one if they exist.
|
||||
var/obj/structure/cliff/bottom_cliff = locate() in T
|
||||
if(bottom_cliff)
|
||||
visible_message(span("danger", "\The [L] rolls down towards \the [bottom_cliff]!"))
|
||||
sleep(5)
|
||||
bottom_cliff.fall_off_cliff(L)
|
||||
|
||||
/obj/structure/cliff/can_climb(mob/living/user, post_climb_check = FALSE)
|
||||
// Cliff climbing requires climbing gear.
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
var/obj/item/clothing/shoes/shoes = H.shoes
|
||||
if(shoes && shoes.rock_climbing)
|
||||
return ..() // Do the other checks too.
|
||||
|
||||
to_chat(user, span("warning", "\The [src] is too steep to climb unassisted."))
|
||||
return FALSE
|
||||
|
||||
// This tells AI mobs to not be dumb and step off cliffs willingly.
|
||||
/obj/structure/cliff/is_safe_to_step(mob/living/L)
|
||||
if(should_fall(L))
|
||||
return FALSE
|
||||
return ..()
|
||||
>>>>>>> b22a056... Sideports a couple of init unit tests from Neb. (#7893)
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
|
||||
/obj/structure/closet/Initialize()
|
||||
..()
|
||||
// Closets need to come later because of spawners potentially creating objects during init.
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/obj/structure/closet/LateInitialize()
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
var/smashed = 0
|
||||
|
||||
/obj/structure/fireaxecabinet/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
fireaxe = new /obj/item/weapon/material/twohanded/fireaxe()
|
||||
|
||||
/obj/structure/fireaxecabinet/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
var/list/harvest_loot = null // Should be an associative list for things to spawn, and their weights. An example would be a branch from a tree.
|
||||
|
||||
/obj/structure/flora/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
if(randomize_size)
|
||||
icon_scale_x = rand(min_x_scale * 100, max_x_scale * 100) / 100
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
icon_state = icon_state_opened
|
||||
if(needscharger)
|
||||
new /obj/machinery/recharge_station/ghost_pod_recharger(src.loc)
|
||||
del(src)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
var/list/clothing_possibilities
|
||||
|
||||
/obj/structure/ghost_pod/ghost_activated/human/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
handle_clothing_setup()
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
var/list/clothing_possibilities
|
||||
|
||||
/obj/structure/ghost_pod/manual/human/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
handle_clothing_setup()
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/ghost_pod/ghost_activated/swarm_drone/event/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
say_dead_object("A <span class='notice'>[drone_class] swarm drone</span> shell is now available in \the [T.loc].", src)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
var/total_creature_max //If set, it can spawn this many creatures, total, ever.
|
||||
|
||||
/obj/structure/prop/nest/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
den_mobs = list()
|
||||
START_PROCESSING(SSobj, src)
|
||||
last_spawn = world.time
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/structure/cult/pylon/swarm/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
active_beams = list()
|
||||
|
||||
/obj/structure/cult/pylon/swarm/Destroy()
|
||||
|
||||
@@ -27,11 +27,10 @@
|
||||
return FALSE
|
||||
|
||||
/obj/effect/wingrille_spawn/Initialize()
|
||||
. = ..()
|
||||
if(!win_path)
|
||||
return
|
||||
if(ticker && ticker.current_state < GAME_STATE_PLAYING)
|
||||
if(win_path && ticker && ticker.current_state < GAME_STATE_PLAYING)
|
||||
activate()
|
||||
..()
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
/obj/effect/wingrille_spawn/proc/activate()
|
||||
if(activated) return
|
||||
@@ -58,7 +57,8 @@
|
||||
activated = 1
|
||||
for(var/obj/effect/wingrille_spawn/other in neighbours)
|
||||
if(!other.activated) other.activate()
|
||||
qdel(src)
|
||||
if(initialized && !QDELETED(src))
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/wingrille_spawn/proc/handle_window_spawn(var/obj/structure/window/W)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user