Ports move force and move resist, movement/pushing/pulling tweaks & co.

This commit is contained in:
Ghommie
2019-10-24 18:01:46 +02:00
parent 432a7dba5d
commit 2c578ca683
121 changed files with 553 additions and 437 deletions

View File

@@ -4,6 +4,7 @@
/obj/effect
icon = 'icons/effects/effects.dmi'
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF
move_resist = INFINITY
obj_flags = 0
/obj/effect/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)

View File

@@ -544,21 +544,21 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
else
return
/obj/item/throw_impact(atom/A, datum/thrownthing/throwingdatum)
if(A && !QDELETED(A))
SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, A, throwingdatum)
if(is_hot() && isliving(A))
var/mob/living/L = A
/obj/item/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(hit_atom && !QDELETED(hit_atom))
SEND_SIGNAL(src, COMSIG_MOVABLE_IMPACT, hit_atom, throwingdatum)
if(is_hot() && isliving(hit_atom))
var/mob/living/L = hit_atom
L.IgniteMob()
var/itempush = 1
if(w_class < 4)
itempush = 0 //too light to push anything
return A.hitby(src, 0, itempush)
return hit_atom.hitby(src, 0, itempush, throwingdatum=throwingdatum)
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
/obj/item/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force)
thrownby = thrower
callback = CALLBACK(src, .proc/after_throw, callback) //replace their callback with our own
. = ..(target, range, speed, thrower, spin, diagonals_first, callback)
. = ..(target, range, speed, thrower, spin, diagonals_first, callback, force)
/obj/item/proc/after_throw(datum/callback/callback)
if (callback) //call the original callback
@@ -649,7 +649,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
else
. = ""
/obj/item/hitby(atom/movable/AM)
/obj/item/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
return
/obj/item/attack_hulk(mob/living/carbon/human/user)

View File

@@ -160,7 +160,7 @@
/obj/item/dice/attack_self(mob/user)
diceroll(user)
/obj/item/dice/throw_impact(atom/target)
/obj/item/dice/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
diceroll(thrownby)
. = ..()

View File

@@ -340,7 +340,7 @@
return
playsound(src.loc,'sound/weapons/bolathrow.ogg', 75, 1)
/obj/item/restraints/legcuffs/bola/throw_impact(atom/hit_atom)
/obj/item/restraints/legcuffs/bola/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(..() || !iscarbon(hit_atom))//if it gets caught or the target can't be cuffed,
return//abort
var/mob/living/carbon/C = hit_atom
@@ -368,7 +368,7 @@
w_class = WEIGHT_CLASS_SMALL
breakouttime = 60
/obj/item/restraints/legcuffs/bola/energy/throw_impact(atom/hit_atom)
/obj/item/restraints/legcuffs/bola/energy/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(iscarbon(hit_atom))
var/obj/item/restraints/legcuffs/beartrap/B = new /obj/item/restraints/legcuffs/beartrap/energy/cyborg(get_turf(hit_atom))
B.Crossed(hit_atom)

View File

@@ -332,13 +332,13 @@
if(proximity_flag)
consume_everything(target)
/obj/item/melee/supermatter_sword/throw_impact(target)
/obj/item/melee/supermatter_sword/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..()
if(ismob(target))
var/mob/M
if(ismob(hit_atom))
var/mob/M = hit_atom
if(src.loc == M)
M.dropItemToGround(src)
consume_everything(target)
consume_everything(hit_atom)
/obj/item/melee/supermatter_sword/pickup(user)
..()

View File

@@ -105,10 +105,10 @@
playsound(src.loc, "sparks", 50, 1)
shock(M)
/obj/item/twohanded/mjollnir/throw_impact(atom/target)
/obj/item/twohanded/mjollnir/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
. = ..()
if(isliving(target))
shock(target)
if(isliving(hit_atom))
shock(hit_atom)
/obj/item/twohanded/mjollnir/update_icon() //Currently only here to fuck with the on-mob icons.
icon_state = "mjollnir[wielded]"

View File

@@ -35,7 +35,7 @@
/obj/item/stack/ore/bluespace_crystal/proc/blink_mob(mob/living/L)
do_teleport(L, get_turf(L), blink_range, asoundin = 'sound/effects/phasein.ogg', channel = TELEPORT_CHANNEL_BLUESPACE)
/obj/item/stack/ore/bluespace_crystal/throw_impact(atom/hit_atom)
/obj/item/stack/ore/bluespace_crystal/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) // not caught in mid-air
visible_message("<span class='notice'>[src] fizzles and disappears upon impact!</span>")
var/turf/T = get_turf(hit_atom)

View File

@@ -335,7 +335,7 @@
merge(o)
. = ..()
/obj/item/stack/hitby(atom/movable/AM, skip, hitpush)
/obj/item/stack/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(istype(AM, merge_type))
merge(AM)
. = ..()

View File

@@ -40,7 +40,7 @@
cell = new preload_cell_type(src)
update_icon()
/obj/item/melee/baton/throw_impact(atom/hit_atom)
/obj/item/melee/baton/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
..()
//Only mob/living types have stun handling
if(status && prob(throw_hit_chance) && iscarbon(hit_atom))

View File

@@ -235,7 +235,7 @@
if(proximity && ismovableatom(O) && O != sliver)
Consume(O, user)
/obj/item/hemostat/supermatter/throw_impact(atom/hit_atom) // no instakill supermatter javelins
/obj/item/hemostat/supermatter/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum) // no instakill supermatter javelins
if(sliver)
sliver.forceMove(loc)
to_chat(usr, "<span class='notice'>\The [sliver] falls out of \the [src] as you throw them.</span>")

View File

@@ -84,7 +84,7 @@
else
return ..()
/obj/item/toy/balloon/throw_impact(atom/hit_atom)
/obj/item/toy/balloon/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..()) //was it caught by a mob?
balloon_burst(hit_atom)
@@ -384,7 +384,7 @@
/obj/item/toy/snappop/fire_act(exposed_temperature, exposed_volume)
pop_burst()
/obj/item/toy/snappop/throw_impact(atom/hit_atom)
/obj/item/toy/snappop/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..())
pop_burst()
@@ -1006,7 +1006,7 @@
icon_state = "minimeteor"
w_class = WEIGHT_CLASS_SMALL
/obj/item/toy/minimeteor/throw_impact(atom/hit_atom)
/obj/item/toy/minimeteor/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..())
playsound(src, 'sound/effects/meteorimpact.ogg', 40, 1)
for(var/mob/M in urange(10, src))
@@ -1055,7 +1055,7 @@
if(user.dropItemToGround(src))
throw_at(target, throw_range, throw_speed)
/obj/item/toy/snowball/throw_impact(atom/hit_atom)
/obj/item/toy/snowball/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
if(!..())
playsound(src, 'sound/effects/pop.ogg', 20, 1)
qdel(src)

View File

@@ -46,7 +46,7 @@
if(BURN)
playsound(src.loc, 'sound/items/welder.ogg', 100, 1)
/obj/hitby(atom/movable/AM)
/obj/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
..()
var/throwdamage = AM.throwforce
if(isobj(AM))
@@ -126,6 +126,17 @@
if(. && !play_soundeffect)
playsound(src, 'sound/effects/meteorimpact.ogg', 100, 1)
/obj/force_pushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
return TRUE
/obj/move_crushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
collision_damage(pusher, force, direction)
return TRUE
/obj/proc/collision_damage(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction)
var/amt = max(0, ((force - (move_resist * MOVE_FORCE_CRUSH_RATIO)) / (move_resist * MOVE_FORCE_CRUSH_RATIO)) * 10)
take_damage(amt, BRUTE)
/obj/attack_slime(mob/living/simple_animal/slime/user)
if(!user.is_adult)
return

View File

@@ -80,7 +80,7 @@
SEND_SIGNAL(src, COMSIG_OBJ_SETANCHORED, anchorvalue)
anchored = anchorvalue
/obj/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback)
/obj/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force)
..()
if(obj_flags & FROZEN)
visible_message("<span class='danger'>[src] shatters into a million pieces!</span>")

View File

@@ -44,6 +44,7 @@
roundstart = FALSE
death = FALSE
anchored = FALSE
move_resist = MOVE_FORCE_NORMAL
density = FALSE
flavour_text = "<span class='big bold'>You are an ash walker.</span><b> Your tribe worships <span class='danger'>the Necropolis</span>. The wastes are sacred ground, its monsters a blessed bounty. You would never leave its beautiful expanse. \
You have seen lights in the distance... they foreshadow the arrival of outsiders that seek to tear apart the Necropolis and its domain. Fresh sacrifices for your nest.</b>"
@@ -118,6 +119,7 @@
roundstart = FALSE
death = FALSE
anchored = FALSE
move_resist = MOVE_FORCE_NORMAL
density = FALSE
var/has_owner = FALSE
var/can_transfer = TRUE //if golems can switch bodies to this new shell

View File

@@ -258,7 +258,7 @@
take_damage(1, BURN, 0, 0)
..()
/obj/structure/grille/hitby(AM as mob|obj)
/obj/structure/grille/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
if(isobj(AM))
if(prob(50) && anchored && !broken)
var/obj/O = AM

View File

@@ -0,0 +1,97 @@
//Necropolis Tendrils, which spawn lavaland monsters and break into a chasm when killed
/obj/structure/spawner/lavaland
name = "necropolis tendril"
desc = "A vile tendril of corruption, originating deep underground. Terrible monsters are pouring out of it."
icon = 'icons/mob/nest.dmi'
icon_state = "tendril"
faction = list("mining")
max_mobs = 3
max_integrity = 250
mob_types = list(/mob/living/simple_animal/hostile/asteroid/basilisk/watcher/tendril)
move_resist=INFINITY // just killing it tears a massive hole in the ground, let's not move it
anchored = TRUE
resistance_flags = FIRE_PROOF | LAVA_PROOF
var/gps = null
var/obj/effect/light_emitter/tendril/emitted_light
/obj/structure/spawner/lavaland/goliath
mob_types = list(/mob/living/simple_animal/hostile/asteroid/goliath/beast/tendril)
/obj/structure/spawner/lavaland/legion
mob_types = list(/mob/living/simple_animal/hostile/asteroid/hivelord/legion/tendril)
GLOBAL_LIST_INIT(tendrils, list())
/obj/structure/spawner/lavaland/Initialize()
. = ..()
emitted_light = new(loc)
for(var/F in RANGE_TURFS(1, src))
if(ismineralturf(F))
var/turf/closed/mineral/M = F
M.ScrapeAway(null, CHANGETURF_IGNORE_AIR)
gps = new /obj/item/gps/internal(src)
GLOB.tendrils += src
/obj/structure/spawner/lavaland/deconstruct(disassembled)
new /obj/effect/collapse(loc)
new /obj/structure/closet/crate/necropolis/tendril(loc)
return ..()
/obj/structure/spawner/lavaland/Destroy()
var/last_tendril = TRUE
if(GLOB.tendrils.len>1)
last_tendril = FALSE
if(last_tendril && !(flags_1 & ADMIN_SPAWNED_1))
if(SSmedals.hub_enabled)
for(var/mob/living/L in view(7,src))
if(L.stat || !L.client)
continue
SSmedals.UnlockMedal("[BOSS_MEDAL_TENDRIL] [ALL_KILL_MEDAL]", L.client)
SSmedals.SetScore(TENDRIL_CLEAR_SCORE, L.client, 1)
GLOB.tendrils -= src
QDEL_NULL(emitted_light)
QDEL_NULL(gps)
return ..()
/obj/effect/light_emitter/tendril
set_luminosity = 4
set_cap = 2.5
light_color = LIGHT_COLOR_LAVA
/obj/effect/collapse
name = "collapsing necropolis tendril"
desc = "Get clear!"
layer = TABLE_LAYER
icon = 'icons/mob/nest.dmi'
icon_state = "tendril"
anchored = TRUE
density = TRUE
var/obj/effect/light_emitter/tendril/emitted_light
/obj/effect/collapse/Initialize()
. = ..()
emitted_light = new(loc)
visible_message("<span class='boldannounce'>The tendril writhes in fury as the earth around it begins to crack and break apart! Get back!</span>")
visible_message("<span class='warning'>Something falls free of the tendril!</span>")
playsound(loc,'sound/effects/tendril_destroyed.ogg', 200, 0, 50, 1, 1)
addtimer(CALLBACK(src, .proc/collapse), 50)
/obj/effect/collapse/Destroy()
QDEL_NULL(emitted_light)
return ..()
/obj/effect/collapse/proc/collapse()
for(var/mob/M in range(7,src))
shake_camera(M, 15, 1)
playsound(get_turf(src),'sound/effects/explosionfar.ogg', 200, 1)
visible_message("<span class='boldannounce'>The tendril falls inward, the ground around it widening into a yawning chasm!</span>")
for(var/turf/T in range(2,src))
if(!T.density)
T.TerraformTurf(/turf/open/chasm/lavaland, /turf/open/chasm/lavaland)
qdel(src)

View File

@@ -0,0 +1,75 @@
/obj/structure/spawner
name = "monster nest"
icon = 'icons/mob/animal.dmi'
icon_state = "hole"
max_integrity = 100
move_resist = MOVE_FORCE_EXTREMELY_STRONG
anchored = TRUE
density = TRUE
var/max_mobs = 5
var/spawn_time = 300 //30 seconds default
var/mob_types = list(/mob/living/simple_animal/hostile/carp)
var/spawn_text = "emerges from"
var/faction = list("hostile")
/obj/structure/spawner/Initialize()
. = ..()
AddComponent(/datum/component/spawner, mob_types, spawn_time, faction, spawn_text, max_mobs)
/obj/structure/spawner/syndicate
name = "warp beacon"
icon = 'icons/obj/device.dmi'
icon_state = "syndbeacon"
spawn_text = "warps in from"
mob_types = list(/mob/living/simple_animal/hostile/syndicate/ranged)
faction = list(ROLE_SYNDICATE)
/obj/structure/spawner/skeleton
name = "bone pit"
desc = "A pit full of bones, and some still seem to be moving..."
icon_state = "hole"
icon = 'icons/mob/nest.dmi'
max_integrity = 150
max_mobs = 15
spawn_time = 150
mob_types = list(/mob/living/simple_animal/hostile/skeleton)
spawn_text = "climbs out of"
faction = list("skeleton")
/obj/structure/spawner/mining
name = "monster den"
desc = "A hole dug into the ground, harboring all kinds of monsters found within most caves or mining asteroids."
icon_state = "hole"
max_integrity = 200
max_mobs = 3
icon = 'icons/mob/nest.dmi'
spawn_text = "crawls out of"
mob_types = list(/mob/living/simple_animal/hostile/asteroid/goldgrub, /mob/living/simple_animal/hostile/asteroid/goliath, /mob/living/simple_animal/hostile/asteroid/hivelord, /mob/living/simple_animal/hostile/asteroid/basilisk, /mob/living/simple_animal/hostile/asteroid/fugu)
faction = list("mining")
/obj/structure/spawner/mining/goldgrub
name = "goldgrub den"
desc = "A den housing a nest of goldgrubs, annoying but arguably much better than anything else you'll find in a nest."
mob_types = list(/mob/living/simple_animal/hostile/asteroid/goldgrub)
/obj/structure/spawner/mining/goliath
name = "goliath den"
desc = "A den housing a nest of goliaths, oh god why?"
mob_types = list(/mob/living/simple_animal/hostile/asteroid/goliath)
/obj/structure/spawner/mining/hivelord
name = "hivelord den"
desc = "A den housing a nest of hivelords."
mob_types = list(/mob/living/simple_animal/hostile/asteroid/hivelord)
/obj/structure/spawner/mining/basilisk
name = "basilisk den"
desc = "A den housing a nest of basilisks, bring a coat."
mob_types = list(/mob/living/simple_animal/hostile/asteroid/basilisk)
/obj/structure/spawner/mining/wumborian
name = "wumborian fugu den"
desc = "A den housing a nest of wumborian fugus, how do they all even fit in there?"
mob_types = list(/mob/living/simple_animal/hostile/asteroid/fugu)