Skip to content

Commit

Permalink
sfdsdfd
Browse files Browse the repository at this point in the history
  • Loading branch information
Anorak2024 committed Nov 15, 2024
1 parent 25e44d6 commit 5bdd9fe
Show file tree
Hide file tree
Showing 28 changed files with 522 additions and 121 deletions.
14 changes: 14 additions & 0 deletions code/__DEFINES/anomalies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@
#define ANOMALY_TYPE_VORTEX "vortex"
#define ANOMALY_TYPE_FLUX "flux"

#define isanomaly(A) (istype((A), /obj/effect/anomaly))

#define iscore(A) (istype((A), /obj/item/assembly/signaler/anomaly))
#define iscoret1(A) (istype((A), /obj/item/assembly/signaler/anomaly/tier1))
#define iscoret2(A) (istype((A), /obj/item/assembly/signaler/anomaly/tier2))
#define iscoret3(A) (istype((A), /obj/item/assembly/signaler/anomaly/tier3))

#define iscoreempty(A) (type in list(/obj/item/assembly/signaler/anomaly/tier1, /obj/item/assembly/signaler/anomaly/tier2, /obj/item/assembly/signaler/anomaly/tier3))
#define iscoreatmos(A) (type in list(/obj/item/assembly/signaler/anomaly/tier1/pyro, /obj/item/assembly/signaler/anomaly/tier2/pyro, /obj/item/assembly/signaler/anomaly/tier3/pyro))
#define iscorebluespace(A) (type in list(/obj/item/assembly/signaler/anomaly/tier1/bluespace, /obj/item/assembly/signaler/anomaly/tier2/bluespace, /obj/item/assembly/signaler/anomaly/tier3/bluespace))
#define iscoregrav(A) (type in list(/obj/item/assembly/signaler/anomaly/tier1/grav, /obj/item/assembly/signaler/anomaly/tier2/grav, /obj/item/assembly/signaler/anomaly/tier3/grav))
#define iscorevortex(A) (type in list(/obj/item/assembly/signaler/anomaly/tier1/vortex, /obj/item/assembly/signaler/anomaly/tier2/vortex, /obj/item/assembly/signaler/anomaly/tier3/vortex))
#define iscoreflux(A) (type in list(/obj/item/assembly/signaler/anomaly/tier1/flux, /obj/item/assembly/signaler/anomaly/tier2/flux, /obj/item/assembly/signaler/anomaly/tier3/flux))

GLOBAL_LIST_INIT(anomaly_types, list(
"1" = list(
ANOMALY_TYPE_ATMOS = /datum/anomaly_gen_datum/tier1/pyroclastic,
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/gravity.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
#define NEGATIVE_GRAVITY -1

#define NO_GRAVITY 0.1
#define NO_GRAVITY 0.3

#define STANDARD_GRAVITY 1 //Anything above this is high gravity, anything below no grav until negative gravity
/// The gravity strength threshold for slownown.
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@

///How much a mob's sprite should be moved when they're lying down
#define PIXEL_Y_OFFSET_LYING -6
///How much a mob's sprite should be moved when they're lying up (on the ceiling)
#define PIXEL_Y_OFFSET_LYING_REVERSED 6

// Slip flags, also known as lube flags
/// The mob will not slip if they're walking intent
Expand Down
22 changes: 11 additions & 11 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -340,29 +340,29 @@ or something covering your eyes."


/atom/movable/screen/alert/negative
name = "Negative Gravity"
desc = "You're getting pulled upwards. While you won't have to worry about falling down anymore, you may accidentally fall upwards!"
name = "Обратная гравитация"
desc = "Вас тянет вверх. Хотя вам больше не придется беспокоиться о падении вниз, вы можете случайно упасть вверх!"
icon_state = "negative"


/atom/movable/screen/alert/weightless
name = "Weightless"
desc = "Gravity has ceased affecting you, and you're floating around aimlessly. You'll need something large and heavy, like a \
wall or lattice, to push yourself off if you want to move. A jetpack would enable free range of motion. A pair of \
magboots would let you walk around normally on the floor. Barring those, you can throw things, use a fire extinguisher, \
or shoot a gun to move around via Newton's 3rd Law of Motion."
name = "Невесомость"
desc = "Гравитация перестала на вас влиять, и вы парите. Вам понадобится что-то большое и тяжелое, например, \
стена или решетка, чтобы оттолкнуться, если вы хотите двигаться. Реактивный ранец обеспечит вам свободу движений. Пара \
магнитных ботинков позволит вам нормально ходить по полу. За исключением этого, вы можете бросать вещи, использовать огнетушитель или \
стрелять из пистолета, чтобы перемещаться согласно третьему закону Ньютона."
icon_state = "weightless"


/atom/movable/screen/alert/highgravity
name = "High Gravity"
desc = "You're getting crushed by high gravity, picking up items and movement will be slowed."
name = "Повышенная гравитация"
desc = "На вас давит высокая гравитация."
icon_state = "paralysis"


/atom/movable/screen/alert/veryhighgravity
name = "Crushing Gravity"
desc = "You're getting crushed by high gravity, picking up items and movement will be slowed. You'll also accumulate brute damage!"
name = "Сокрушительная гравитация"
desc = "На вас давит невероятно высокая гравитация. Это пагубно сказывается на вашем организме!"
icon_state = "paralysis"


Expand Down
10 changes: 10 additions & 0 deletions code/datums/gravity.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,16 @@
if(!gravity_sources[id])
gravity_sources.Remove(id)

if(isliving(src))
var/mob/living/M = src
M.refresh_gravity()

/atom/proc/remove_gravity_source(id)
gravity_sources.Remove(id)
if(isliving(src))
var/mob/living/M = src
M.refresh_gravity()

/atom/proc/add_ignored_gravity_source(id)
if(!(id in ignored_gravity_sources))
ignored_gravity_sources[id] = 1
Expand Down
6 changes: 4 additions & 2 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@
* * continuous_move - If this check is coming from something in the context of already drifting
*/
/atom/movable/proc/Process_Spacemove(movement_dir = NONE, continuous_move = FALSE)
if(no_gravity())
if(!no_gravity())
return TRUE

if(SEND_SIGNAL(src, COMSIG_MOVABLE_SPACEMOVE, movement_dir, continuous_move) & COMSIG_MOVABLE_STOP_SPACEMOVE)
Expand Down Expand Up @@ -1164,6 +1164,7 @@
SSthrowing.processing[src] = thrown_thing
thrown_thing.tick()

update_icon()
return TRUE

/atom/movable/proc/random_throw(range_low, range_high, speed)
Expand All @@ -1172,7 +1173,8 @@
if(get_dist(T, src) >= range_low && get_dist(T, src) <= range_high)
targets.Add(T)

return throw_at(pick(targets), speed)
var/turf/target = pick(targets)
return throw_at(target, get_dist(src, target), speed)

//Overlays
/atom/movable/overlay
Expand Down
5 changes: 5 additions & 0 deletions code/game/objects/buckling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
target.set_glide_size(glide_size)
target.setDir(dir)

REMOVE_TRAIT(target, TRAIT_FLOORED, GRAVITATION_TRAIT)
post_buckle_mob(target)

SEND_SIGNAL(src, COMSIG_MOVABLE_BUCKLE, target, force)
Expand Down Expand Up @@ -157,6 +158,10 @@
if(istype(location) && !buckled_mob.currently_z_moving)
location.zFall(buckled_mob)

if(isliving(src))
var/mob/living/M = src
M.refresh_gravity()

post_unbuckle_mob(.)

if(!QDELETED(buckled_mob) && !buckled_mob.currently_z_moving && isturf(buckled_mob.loc)) // In the case they unbuckled to a flying movable midflight.
Expand Down
72 changes: 58 additions & 14 deletions code/modules/anomalies/anomalies/anomaly.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,31 @@
/// List of impulses datums.
var/list/datum/anomaly_impulse/impulses = list()

/obj/effect/anomaly/Initialize(spawnloc, spawn_strenght = rand(30, 70), spawn_stability = rand(10, 29))
. = ..()
if(!get_area(src))
return INITIALIZE_HINT_QDEL

/// The moment from which the anomaly will be able to move.
var/move_moment = 0
/// The moment from which the anomaly will be able to move by impulse.
var/move_impulse_moment = 0
/// The amount by which the strength of the anomaly's effects is temporarily reduced.
var/weaken = 0
/// The moment at which the reduction in the effects of the anomaly will be reset.
var/weaken_moment = 0

/obj/effect/anomaly/proc/init_animation()
var/matrix/M = matrix()
M.Scale(0.1, 0.1)
animate(src, transform = M, time = 0)
var/mult = (spawn_strenght + 50) / 100 * 20
var/mult = (strenght + 50) / 100 * 20
mult *= tier * tier
M.Scale(mult, mult)
animate(src, transform = M, time = 1 SECONDS, alpha = 255)
sleep(1 SECONDS)

/obj/effect/anomaly/Initialize(spawnloc, spawn_strenght = rand(30, 70), spawn_stability = rand(10, 29))
. = ..()
if(!get_area(src))
return INITIALIZE_HINT_QDEL

INVOKE_ASYNC(src, TYPE_PROC_REF(/obj/effect/anomaly, init_animation))
set_strenght(spawn_strenght)
stability = spawn_stability

Expand All @@ -60,11 +72,11 @@

// It is in function because the size will change depending on the strength of the anomaly.
/obj/effect/anomaly/proc/set_strenght(new_strenght)
strenght = new_strenght
var/matrix/M = matrix()
var/mult = (new_strenght + 50) / (strenght + 50)
var/mult = (strenght + 100) / 200
M.Scale(mult, mult)
animate(src, transform = M, time = 0)
strenght = new_strenght
animate(src, transform = M, time = 0.1 SECONDS)

/obj/effect/anomaly/proc/collapse()
visible_message(span_warning("Вы видите как [src] достигает критической массы, в следствии чего, разрушается!"))
Expand All @@ -80,7 +92,10 @@
smoke.set_up(tier * 3, FALSE, loc)
smoke.start()

new core_type(loc)
if(strenght < 50)
core_type = text2path("/obj/item/assembly/signaler/anomaly/tier[tier]")

new core_type(loc, strenght)
GLOB.poi_list.Remove(src)
qdel(src)

Expand All @@ -107,6 +122,9 @@

/obj/effect/anomaly/CanAllowThrough(atom/movable/mover, border_dir)
. = ..()
if(istype(mover, /obj/item/projectile/beam/anomaly))
return FALSE

if(ismob(mover))
return mob_touch_effect(mover)

Expand Down Expand Up @@ -162,10 +180,20 @@
for(var/mob/living/M in get_turf(src))
mob_touch_effect(M)

/obj/effect/anomaly/proc/move()
step(src, get_move_dir())
/obj/effect/anomaly/proc/normal_move()
if(world.time > move_moment)
return do_move(get_move_dir())

/obj/effect/anomaly/proc/do_move(dir)
step(src, dir)
return TRUE

/obj/effect/anomaly/proc/get_strenght()
if(world.time > weaken_moment)
weaken = 0

return max(min(strenght, 10), strenght - weaken)

/obj/effect/anomaly/process()
if(stability < 30)
set_strenght(strenght + 1)
Expand All @@ -189,8 +217,24 @@
level_down()
return

if(!prob(strenght))
if(!prob(get_strenght()))
return

if(move())
if(normal_move())
after_move()

/obj/effect/anomaly/proc/go_to(target, steps)
var/reversed = steps < 0
if(reversed)
steps = -steps

for(var/i = 1 to steps)
var/move_dir
if(reversed)
move_dir = get_dir(target, src)
else
move_dir = get_dir(src, target)

do_move(move_dir)
sleep(2)

8 changes: 4 additions & 4 deletions code/modules/anomalies/anomalies/atmospheric.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
var/collapse_slimes_high = 0

/obj/effect/anomaly/pyro/collapse()
for(var/turf/simulated/T in range(collapse_range * 2, src))
for(var/turf/simulated/T in view(collapse_range * 2, src))
T.temperature = rand(0, 50)

for(var/turf/simulated/T in range(collapse_range, src))
for(var/turf/simulated/floor/T in view(collapse_range, src))
var/near_ice = 0 // Generation will be more beautiful.
for(var/turf/simulated/checked in range(1, T))
for(var/turf/simulated/checked in view(1, T))
if(checked.GetComponent(/datum/component/wet_floor))
near_ice++

Expand All @@ -25,7 +25,7 @@
else
T.MakeSlippery(TURF_WET_ICE, 120 SECONDS)

for(var/mob/living/M in range(collapse_range, src))
for(var/mob/living/M in view(collapse_range, src))
if(prob(50))
M.adjust_fire_stacks(20)
M.IgniteMob()
Expand Down
16 changes: 8 additions & 8 deletions code/modules/anomalies/anomalies/bluespace.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@

/obj/effect/anomaly/bluespace/mob_touch_effect(mob/living/M)
..()
var/radius = bump_tp_min + round((bump_tp_max - bump_tp_min) * strenght / 100)
var/radius = bump_tp_min + round((bump_tp_max - bump_tp_min) * get_strenght() / 100)
teleport(M, radius)
return FALSE

/obj/effect/anomaly/bluespace/item_touch_effect(obj/item/I)
..()
var/radius = bump_tp_min + round((bump_tp_max - bump_tp_min) * strenght / 100)
var/radius = bump_tp_min + round((bump_tp_max - bump_tp_min) * get_strenght() / 100)
teleport(I, radius)
return FALSE

/obj/effect/anomaly/bluespace/attackby(obj/item/I, mob/living/user, params)
. = ..()
var/radius = bump_tp_min + round((bump_tp_max - bump_tp_min) * strenght / 100)
var/radius = bump_tp_min + round((bump_tp_max - bump_tp_min) * get_strenght() / 100)
teleport(user, radius)

/obj/effect/anomaly/bluespace/collapse()
Expand All @@ -63,16 +63,16 @@
stronger_anomaly_type = /obj/effect/anomaly/bluespace/tier2
tier = 1
impulses_types = list(
/datum/anomaly_impulse/bs_selftp/tier1,
/datum/anomaly_impulse/move/bs_selftp/tier1,
)

bump_tp_min = 1
bump_tp_max = 2
collapse_radius = 3
collapse_tp_radius = 5

// Moves only by /datum/anomaly_impulse/bs_selftp
/obj/effect/anomaly/bluespace/tier1/move()
// Moves only by /datum/anomaly_impulse/move/bs_selftp
/obj/effect/anomaly/bluespace/tier1/normal_move()
return FALSE

/obj/effect/anomaly/bluespace/tier2
Expand All @@ -89,7 +89,7 @@
stronger_anomaly_type = /obj/effect/anomaly/bluespace/tier3
tier = 2
impulses_types = list(
/datum/anomaly_impulse/bs_selftp/tier2,
/datum/anomaly_impulse/move/bs_selftp/tier2,
/datum/anomaly_impulse/bs_tp_other/tier2,
/datum/anomaly_impulse/wormholes/tier2,
)
Expand All @@ -112,7 +112,7 @@
weaker_anomaly_type = /obj/effect/anomaly/bluespace/tier2
tier = 3
impulses_types = list(
/datum/anomaly_impulse/bs_selftp/tier3,
/datum/anomaly_impulse/move/bs_selftp/tier3,
/datum/anomaly_impulse/bs_tp_other/tier3,
/datum/anomaly_impulse/wormholes/tier3,
)
Expand Down
Loading

0 comments on commit 5bdd9fe

Please sign in to comment.