Skip to content

Commit

Permalink
THE changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
MLGTASTICa committed Aug 13, 2024
1 parent 04b978a commit 7a99cae
Show file tree
Hide file tree
Showing 18 changed files with 252 additions and 254 deletions.
2 changes: 2 additions & 0 deletions code/__DEFINES/__atomFlags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
#define AF_IGNORE_ON_BULLETSCAN (1<<6)
/// This atom will get ignored by explosions
#define AF_EXPLOSION_IGNORANT (1<<8)
/// Uses the aiming level for shooting at the shooter instead.
#define AF_PASS_AIMING_LEVEL (1<<9)
3 changes: 3 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@
return

/atom/getAimingLevel(atom/shooter, defZone)
if(atomFlags & AF_PASS_AIMING_LEVEL)
if(isliving(shooter))
return shooter.getAimingLevel(shooter, defZone)
if(hitbox)
return hitbox.getAimingLevel(shooter, defZone, src)
else
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/alarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
var/turf/toAttach = get_step(loc, reverse_dir[dir])

if(iswall(toAttach))
toAttach.attachGameAtom(src, ATFS_PRIORITIZE_ATTACHED_FOR_HITS, ATFA_EASY_INTERACTIVE | ATFA_DIRECTIONAL_HITTABLE | ATFA_CENTER_ON_SUPPORTER)
toAttach.attachGameAtom(src, ATFS_PRIORITIZE_ATTACHED_FOR_HITS, ATFA_EASY_INTERACTIVE | ATFA_DIRECTIONAL_HITTABLE )
else
stack_trace("[src.type] has no wall to attach itself to at X:[x] Y:[y] Z:[z]")
// the players need to be confused so they complain about it!
Expand Down Expand Up @@ -1221,7 +1221,7 @@ FIRE ALARM
var/turf/toAttach = get_step(loc, reverse_dir[dir])

if(iswall(toAttach))
toAttach.attachGameAtom(src, ATFS_PRIORITIZE_ATTACHED_FOR_HITS, ATFA_EASY_INTERACTIVE | ATFA_DIRECTIONAL_HITTABLE | ATFA_CENTER_ON_SUPPORTER)
toAttach.attachGameAtom(src, ATFS_PRIORITIZE_ATTACHED_FOR_HITS, ATFA_EASY_INTERACTIVE | ATFA_DIRECTIONAL_HITTABLE )
else
stack_trace("[src.type] has no wall to attach itself to at X:[x] Y:[y] Z:[z]")
// the players need to be confused so they complain about it!
Expand Down
1 change: 0 additions & 1 deletion code/game/objects/structures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
return PROJECTILE_CONTINUE
return PROJECTILE_STOP


/obj/structure/New()
..()
if(climbable)
Expand Down
16 changes: 0 additions & 16 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,22 +147,6 @@
qdel(src)
return


/obj/structure/window/bullet_act(obj/item/projectile/Proj, defZone, hitboxFlags)

. = PROJECTILE_CONTINUE
var/targetzone = check_zone(Proj.def_zone)
if(targetzone in list(BP_CHEST, BP_HEAD, BP_L_ARM, BP_R_ARM))
var/proj_damage = Proj.get_structure_damage()
if(proj_damage)
hit(proj_damage)
..()
if(!QDELETED(src))
return PROJECTILE_STOP

return PROJECTILE_STOP


//TODO: Make full windows a separate type of window.
//Once a full window, it will always be a full window, so there's no point
//having the same type for both.
Expand Down
4 changes: 1 addition & 3 deletions code/game/turfs/space/space.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
name = "\proper space"
icon_state = "0"
dynamic_lighting = 0
atomFlags = AF_PASS_AIMING_LEVEL

plane = PLANE_SPACE
layer = SPACE_LAYER
Expand All @@ -21,9 +22,6 @@
/turf/space/bullet_act(obj/item/projectile/P, def_zone, hitboxFlags)
return PROJECTILE_CONTINUE

/turf/space/getAimingLevel(atom/shooter, defZone)
return shooter.getAimingLevel(shooter, defZone)

/turf/space/take_damage(target_power, damage_type)
return TRUE

Expand Down
2 changes: 2 additions & 0 deletions code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

var/footstep_type

atomFlags = AF_PASS_AIMING_LEVEL

//Properties for airtight tiles (/wall)
var/thermal_conductivity = 0.05
var/heat_capacity = 1
Expand Down
14 changes: 7 additions & 7 deletions code/modules/power/apc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
anchored = TRUE
use_power = NO_POWER_USE
req_access = list(access_engine_equip)
//hitbox = /datum/hitboxDatum/atom/apc
hitbox = /datum/hitboxDatum/atom/areaPowerController
var/need_sound
var/area/area
var/areastring
Expand Down Expand Up @@ -183,13 +183,13 @@
/obj/machinery/power/apc/set_dir()
. = ..()
switch(dir)
if(NORTH)
pixel_y = 28
if(SOUTH)
pixel_y = 28
if(NORTH)
pixel_y = -28
if(EAST)
pixel_x = 28
if(WEST)
pixel_x = 28
if(EAST)
pixel_x = -28


Expand Down Expand Up @@ -222,10 +222,10 @@
log_mapping("Duplicate APC created at [AREACOORD(src)]. Original at [AREACOORD(area.apc)].")
area.apc = src

var/turf/toAttach = get_step(loc, dir)
var/turf/toAttach = get_step(loc, reverse_dir[dir])

if(iswall(toAttach))
toAttach.attachGameAtom(src, ATFS_PRIORITIZE_ATTACHED_FOR_HITS, ATFA_EASY_INTERACTIVE | ATFA_DIRECTIONAL_HITTABLE | ATFA_CENTER_ON_SUPPORTER)
toAttach.attachGameAtom(src, ATFS_PRIORITIZE_ATTACHED_FOR_HITS, ATFA_EASY_INTERACTIVE | ATFA_DIRECTIONAL_HITTABLE )
else
stack_trace("[src.type] has no wall to attach itself to at X:[x] Y:[y] Z:[z]")
// the players need to be confused so they complain about it!
Expand Down
22 changes: 16 additions & 6 deletions code/modules/projectiles/hitbox_datums.dm
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,14 @@ boolean lineLine(float x1, float y1, float x2, float y2, float x3, float y3, flo
LISTWEST = list(BBOX(10,9,23,25,LEVEL_CHEST-1,LEVEL_CHEST+2,null))
)

/datum/hitboxDatum/atom/areaPowerController
boundingBoxes = list(
LISTNORTH = list(BBOX(8,10,24,23,LEVEL_CHEST-1,LEVEL_CHEST+2,null)),
LISTSOUTH = list(BBOX(8,10,24,23,LEVEL_CHEST-1,LEVEL_CHEST+2,null)),
LISTEAST = list(BBOX(10,8,23,24,LEVEL_CHEST-1,LEVEL_CHEST+2,null)),
LISTWEST = list(BBOX(10,9,23,25,LEVEL_CHEST-1,LEVEL_CHEST+2,null))
)

/datum/hitboxDatum/atom/window/directional
boundingBoxes = list(
LISTNORTH = list(BBOX(1,26,32,32, LEVEL_TURF, LEVEL_ABOVE, null)),
Expand All @@ -333,6 +341,14 @@ boolean lineLine(float x1, float y1, float x2, float y2, float x3, float y3, flo
LISTWEST = list(BBOX(0,0,32,32, LEVEL_TURF, LEVEL_LOWWALL, null))
)

/datum/hitboxDatum/atom/reagentTank
boundingBoxes = list(
LISTNORTH = list(BBOX(5,4,31,28, LEVEL_TURF, LEVEL_TABLE, null)),
LISTSOUTH = list(BBOX(5,4,31,28, LEVEL_TURF, LEVEL_TABLE, null)),
LISTEAST = list(BBOX(5,4,31,28, LEVEL_TURF, LEVEL_TABLE, null)),
LISTWEST = list(BBOX(5,4,31,28, LEVEL_TURF, LEVEL_TABLE, null))
)

/datum/hitboxDatum/turf
boundingBoxes = BBOX(0,0,32,32,LEVEL_BELOW ,LEVEL_ABOVE,null)

Expand Down Expand Up @@ -371,12 +387,6 @@ boolean lineLine(float x1, float y1, float x2, float y2, float x3, float y3, flo
return TRUE
return FALSE

/datum/hitboxDatum/turf/getAimingLevel(atom/shooter, defZone, atom/owner)
if(isliving(shooter))
return shooter.getAimingLevel(shooter, defZone)
else
return ..()

/datum/hitboxDatum/turf/wall
boundingBoxes = BBOX(0,0,32,32,LEVEL_BELOW ,LEVEL_ABOVE,null)

Expand Down
4 changes: 2 additions & 2 deletions code/modules/reagents/reagent_dispenser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
name = "water tank"
desc = "A water tank. It is used to store high amounts of water."
icon_state = "watertank"
hitbox = /datum/hitboxDatum/atom/reagentTank
amount_per_transfer_from_this = 10
volume = 1500
starting_reagent = "water"
Expand Down Expand Up @@ -108,6 +109,7 @@
desc = "A tank full of industrial welding fuel. Do not consume."
description_antag = "Can have an assembly with a igniter attached for detonation upon a trigger. Can also use a screwdriver to leak fuel when dragged"
icon = 'icons/obj/objects.dmi'
hitbox = /datum/hitboxDatum/atom/reagentTank
icon_state = "weldtank"
amount_per_transfer_from_this = 10
volume = 500
Expand Down Expand Up @@ -197,8 +199,6 @@
message_admins("[key_name_admin(Proj.firer)] shot fueltank at [loc.loc.name] ([loc.x],[loc.y],[loc.z]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[loc.x];Y=[loc.y];Z=[loc.z]'>JMP</a>).")
log_game("[key_name(Proj.firer)] shot fueltank at [loc.loc.name] ([loc.x],[loc.y],[loc.z]).")

if(!istype(Proj ,/obj/item/projectile/beam/lastertag) && !istype(Proj ,/obj/item/projectile/beam/practice) )
explode()
/obj/structure/reagent_dispensers/fueltank/explosion_act(target_power, explosion_handler/handle)
if(target_power > health)
explode()
Expand Down
Loading

0 comments on commit 7a99cae

Please sign in to comment.