Skip to content

Commit

Permalink
This is prob fucked up
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton-Kr committed Mar 5, 2022
1 parent 887dd0e commit 28154a6
Show file tree
Hide file tree
Showing 17 changed files with 5,534 additions and 1,972 deletions.
2 changes: 2 additions & 0 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,7 @@
#include "code\game\objects\structures\crates_lockers\crates.dm"
#include "code\game\objects\structures\crates_lockers\largecrate.dm"
#include "code\game\objects\structures\crates_lockers\med_crate.dm"
#include "code\game\objects\structures\crates_lockers\munitions_crate.dm"
#include "code\game\objects\structures\crates_lockers\closets\__closet.dm"
#include "code\game\objects\structures\crates_lockers\closets\_closet_appearance_definitions.dm"
#include "code\game\objects\structures\crates_lockers\closets\coffin.dm"
Expand Down Expand Up @@ -2656,6 +2657,7 @@
#include "code\modules\overmap\projectiles\missiles\equipment\payload\diffuser.dm"
#include "code\modules\overmap\projectiles\missiles\equipment\payload\emp.dm"
#include "code\modules\overmap\projectiles\missiles\equipment\payload\explosive.dm"
#include "code\modules\overmap\projectiles\missiles\equipment\payload\payload.dm"
#include "code\modules\overmap\projectiles\missiles\equipment\utility\armer.dm"
#include "code\modules\overmap\projectiles\missiles\equipment\utility\passenger.dm"
#include "code\modules\overmap\projectiles\missiles\equipment\utility\thruster.dm"
Expand Down
4 changes: 4 additions & 0 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ var/list/airlock_overlays = list()
door_color = COLOR_WHITE
stripe_color = COLOR_NT_RED

/obj/machinery/door/airlock/munitions
door_color = COLOR_RED
stripe_color = COLOR_AMBER

/obj/machinery/door/airlock/engineering
name = "Maintenance Hatch"
door_color = COLOR_AMBER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,26 @@
/decl/closet_appearance/crate/freezer
color = COLOR_BABY_BLUE

/decl/closet_appearance/crate/munitions/thruster
color = COLOR_GREEN_GRAY
decals = list(
"crate_stripe_left" = COLOR_YELLOW
)

/decl/closet_appearance/crate/munitions/payload
color = COLOR_GREEN_GRAY
decals = list(
"crate_stripe_left" = COLOR_RED
)

/decl/closet_appearance/crate/munitions/equipment
color = COLOR_GREEN_GRAY
decals = list(
"crate_stripe_left" = COLOR_PALE_BLUE_GRAY
)



/decl/closet_appearance/crate/secure
can_lock = TRUE

Expand Down
104 changes: 104 additions & 0 deletions code/game/objects/structures/crates_lockers/munitions_crate.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*
THRUSTERS
*/
/obj/structure/closet/crate/munitions/thruster
name = "\improper Missile thruster crate"
desc = "A crate containing missile thrusters."
closet_appearance = /decl/closet_appearance/crate/munitions/thruster

/obj/structure/closet/crate/munitions/thruster/point
name = "\improper Missile point thruster crate"
desc = "A crate containing point thrusters."

/obj/structure/closet/crate/munitions/thruster/planet
name = "\improper Missile planet thruster crate"
desc = "A crate containing missile planet thrusters."

/obj/structure/closet/crate/munitions/thruster/hunter
name = "\improper Missile planet thruster crate"
desc = "A crate containing missile planet thrusters."


/obj/structure/closet/crate/munitions/thruster/WillContain()
return list(
/obj/item/missile_equipment/thruster = 20,
)

/obj/structure/closet/crate/munitions/thruster/point/WillContain()
return list(
/obj/item/missile_equipment/thruster/point = 10,
)

/obj/structure/closet/crate/munitions/thruster/planet/WillContain()
return list(
/obj/item/missile_equipment/thruster = 10,
)

/obj/structure/closet/crate/munitions/thruster/hunter/WillContain()
return list(
/obj/item/missile_equipment/thruster = 5,
)

/*
PAYLOADS
*/

/obj/structure/closet/crate/munitions/payload
name = "\improper Missile payload crate"
desc = "A crate containing missile payloads."
closet_appearance = /decl/closet_appearance/crate/munitions/payload

/obj/structure/closet/crate/munitions/payload/diffuser
name = "\improper Missile diffuser payload crate"
desc = "A crate containing diffuser missile payloads."

/obj/structure/closet/crate/munitions/payload/emp
name = "\improper Missile EMP payload crate"
desc = "A crate containing EMP missile payloads."

/obj/structure/closet/crate/munitions/payload/explosive
name = "\improper Missile explosive payload crate"
desc = "A crate containing explosive missile payloads."

/obj/structure/closet/crate/munitions/payload/antimissile
name = "\improper Missile antimissile payload crate"
desc = "A crate containing antimissile missile payloads."



/obj/structure/closet/crate/munitions/payload/diffuser/WillContain()
return list(
/obj/item/missile_equipment/payload/diffuser = 5,
)

/obj/structure/closet/crate/munitions/payload/emp/WillContain()
return list(
/obj/item/missile_equipment/payload/emp = 5,
)

/obj/structure/closet/crate/munitions/payload/explosive/WillContain()
return list(
/obj/item/missile_equipment/payload/explosive = 15,
)

/obj/structure/closet/crate/munitions/payload/antimissile/WillContain()
return list(
/obj/item/missile_equipment/payload/antimissile = 10,
)
/*
Equipment
*/

/obj/structure/closet/crate/munitions/equipment
name = "\improper Missile equipment crate"
desc = "A crate containing explosive missile equipment."
closet_appearance = /decl/closet_appearance/crate/munitions/equipment

/obj/structure/closet/crate/munitions/equipment/autoarm
name = "\improper Missile autoarm crate"
desc = "A crate containing autoarm missile equipment."

/obj/structure/closet/crate/munitions/equipment/autoarm/WillContain()
return list(
/obj/item/missile_equipment/autoarm = 20,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Destroys missiles that are traveling on the overmap
/obj/item/missile_equipment/payload
name = "missile payload"
desc = "dangerous equipment!!"

/obj/item/missile_equipment/payload/on_missile_activated(var/obj/effect/overmap/projectile/P)
P.set_dangerous(TRUE)
P.set_enter_zs(TRUE)

/obj/item/missile_equipment/payload/on_trigger()
qdel(loc)
36 changes: 16 additions & 20 deletions code/modules/overmap/projectiles/missiles/missile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
var/maintenance_hatch_open = FALSE
var/active = FALSE
var/entered_away = FALSE
var/list/equipment
var/list/equipment = list()
var/obj/effect/overmap/projectile/overmap_missile = null

var/obj/effect/overmap/origin = null

/obj/structure/missile/proc/get_additional_info()
Expand All @@ -37,23 +37,23 @@
info += ("<li>" + E.name)
info += "</ul>"
return JOINTEXT(info)

/*
/obj/structure/missile/proc/update_bounds()
if(dir in list(EAST, WEST))
bound_width = 2 * world.icon_size
bound_height = world.icon_size
else
bound_width = world.icon_size
bound_height = 2 * world.icon_size

*/
/obj/structure/missile/Initialize()
. = ..()

for(var/i = 1; i <= LAZYLEN(equipment); i++)
var/path = equipment[i]
equipment[i] = new path(src)

update_bounds()
// update_bounds()
update_icon()

/obj/structure/missile/Destroy()
Expand All @@ -68,7 +68,7 @@

/obj/structure/missile/Move()
. = ..()
update_bounds()
//update_bounds()

// for some reason, touch_map_edge doesn't always trigger like it should
// this ensures that it does
Expand All @@ -81,7 +81,7 @@

// Move to the overmap until we encounter a new z
/obj/structure/missile/touch_map_edge()

//Missile destroyed if it fails to hit something
if(entered_away)
Destroy()
Expand All @@ -101,9 +101,9 @@
if(overmap_missile.dangerous)
log_and_message_admins("A dangerous missile has entered the overmap (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[overmap_missile.x];Y=[overmap_missile.y];Z=[overmap_missile.z]'>JMP</a>)")


origin = map_sectors["[z]"]

// Abort walk
walk(src, 0)
forceMove(overmap_missile)
Expand Down Expand Up @@ -193,10 +193,6 @@
var/start_x = Floor(world.maxx / 2) + rand(-10, 10)
var/start_y = Floor(world.maxy / 2) + rand(-10, 10)

//Oh god oh fuck
//TODO: CURRENTLY CHECKING OBJ HEADING AND NOT OVERMAP HEADING WHICH IS WHY THIS IS FUCKED UP


if(heading == target_dir)
if(target_fore_dir == NORTH)
start_y = TRANSITIONEDGE + 2
Expand All @@ -221,7 +217,7 @@
else if(target_fore_dir == WEST)
start_x = TRANSITIONEDGE + 2
heading = EAST
else
else
start_x = world.maxx - TRANSITIONEDGE - 2
heading = WEST

Expand All @@ -235,10 +231,10 @@
else if(target_fore_dir == WEST)
start_y = TRANSITIONEDGE + 2
heading = NORTH
else
else
start_y = world.maxy - TRANSITIONEDGE - 2
heading = SOUTH

else if(heading == GLOB.ccw_dir[target_dir])
if(target_fore_dir == NORTH)
start_x = world.maxx - TRANSITIONEDGE - 2
Expand All @@ -249,23 +245,23 @@
else if(target_fore_dir == WEST)
start_y = world.maxy - TRANSITIONEDGE - 2
heading = SOUTH
else
else
start_y = TRANSITIONEDGE + 2
heading = NORTH

var/turf/start = locate(start_x, start_y, z_level)


if(overmap_missile.dangerous)
log_and_message_admins("A dangerous missile has entered z level [z_level] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[x];Y=[y];Z=[z]'>JMP</a>)")


// if we enter into a dense place, just detonate immediately
if(start.contains_dense_objects())
forceMove(start)
detonate()
return

forceMove(start)

// let missile equipment decide a target
Expand Down
6 changes: 3 additions & 3 deletions code/modules/overmap/ships/computers/target_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,19 @@
return TOPIC_NOACTION

if (href_list["ship_lock"])
var/obj/effect/overmap/O = locate(href_list["lock"])
var/obj/effect/overmap/O = locate(href_list["ship_lock"])
if(istype(O) && !QDELETED(O) && (O in view(7,linked)))
linked.set_target(TARGET_SHIP, O)
return TOPIC_HANDLED

if (href_list["missile_lock"])
var/obj/effect/overmap/O = locate(href_list["lock"])
var/obj/effect/overmap/O = locate(href_list["missile_lock"])
if(istype(O) && !QDELETED(O) && (O in view(7,linked)))
linked.set_target(TARGET_MISSILE, O)
return TOPIC_HANDLED

if (href_list["planet_lock"])
var/obj/effect/overmap/O = locate(href_list["lock"])
var/obj/effect/overmap/O = locate(href_list["planet_lock"])
if(istype(O) && !QDELETED(O) && (O in view(7,linked)))
linked.set_target(TARGET_PLANET, O, linked.get_target(TARGET_PLANET)[2], linked.get_target(TARGET_PLANET)[3])
return TOPIC_HANDLED
Expand Down
4 changes: 3 additions & 1 deletion code/modules/overmap/ships/ship.dm
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@

/obj/effect/overmap/visitable/ship/proc/check_target(obj/effect/overmap/target)
if(target in view(7, src))
to_world("returned true")
return TRUE
to_world("return false")
return FALSE

/obj/effect/overmap/visitable/ship/proc/get_target(var/target_type)
Expand All @@ -311,7 +313,7 @@
return null

/obj/effect/overmap/visitable/ship/proc/set_target(var/target_type, var/obj/effect/overmap/target, var/target_x, var/target_y)

to_world("got here")
if(target_type == TARGET_SHIP)
if(target && check_target(target))
ship_target = target
Expand Down
Loading

0 comments on commit 28154a6

Please sign in to comment.