Skip to content

Commit

Permalink
refactor: KA modkits compatibility. (ss220-space#4600)
Browse files Browse the repository at this point in the history
* Update kinetic_accelerator.dm

* Done.

* Update necropolis_chests.dm

* Update kinetic_accelerator.dm

* Update kinetic_accelerator.dm

* Stultus

* UNDEFI ZABIL

* Zwei corrections 1/2.

* Zwei corrections 2/2.
  • Loading branch information
Daeberdir authored Mar 21, 2024
1 parent 26cbe0b commit 227bccb
Show file tree
Hide file tree
Showing 13 changed files with 354 additions and 272 deletions.
2 changes: 1 addition & 1 deletion _maps/map_files/RandomRuins/SpaceRuins/anomalyship.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@
pixel_x = 8;
pixel_y = 13
},
/obj/item/borg/upgrade/modkit/cooldown{
/obj/item/borg/upgrade/modkit/cooldown/haste{
pixel_x = -5;
pixel_y = 1
},
Expand Down
2 changes: 1 addition & 1 deletion _maps/map_files/RandomZLevels/academy.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -6517,7 +6517,7 @@
/area/awaymission/academy/academyaft)
"UV" = (
/obj/structure/table/wood,
/obj/item/borg/upgrade/modkit/cooldown,
/obj/item/borg/upgrade/modkit/cooldown/haste,
/obj/structure/sign/poster/contraband/random{
pixel_y = -32
},
Expand Down
1 change: 0 additions & 1 deletion code/game/objects/items/robot/robot_upgrades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
icon = 'icons/obj/module.dmi'
icon_state = "cyborg_upgrade"
origin_tech = "programming=2"
var/locked = FALSE
var/installed = FALSE
var/require_module = FALSE
var/module_type = null
Expand Down
3 changes: 1 addition & 2 deletions code/modules/mining/equipment/upgrades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@
for(var/obj/item/flashlight/seclite/S in gun)
S.loc = get_turf(user)
S.update_brightness(user)
for(var/obj/item/borg/upgrade/modkit/kit in gun.modkits)
kit.uninstall(gun)
gun.deattach_modkits()
qdel(gun)
var/obj/item/gun/energy/kinetic_accelerator/mega/newgun = new(get_turf(user))
user.put_in_hands(newgun)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mining/lavaland/necropolis_chests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@
modkit_design = /datum/design/unique_modkit/bounty

/datum/design/unique_modkit
build_type = PROTOLATHE
req_tech = null // Unreachable by tech researching.
build_type = PROTOLATHE | MECHFAB

/datum/design/unique_modkit/offensive_turf_aoe
name = "Kinetic Accelerator Offensive Mining Explosion Mod"
Expand Down
13 changes: 8 additions & 5 deletions code/modules/mining/machine_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,16 @@
EQUIPMENT("Kinetic Accelerator", /obj/item/gun/energy/kinetic_accelerator, 1000),
EQUIPMENT("KA Adjustable Tracer Rounds", /obj/item/borg/upgrade/modkit/tracer/adjustable, 200),
EQUIPMENT("KA AoE Damage", /obj/item/borg/upgrade/modkit/aoe/mobs, 2500),
EQUIPMENT("KA Cooldown Decrease", /obj/item/borg/upgrade/modkit/cooldown, 1500),
EQUIPMENT("KA Cooldown Decrease", /obj/item/borg/upgrade/modkit/cooldown/haste, 1500),
EQUIPMENT("KA Damage Increase", /obj/item/borg/upgrade/modkit/damage, 1500),
EQUIPMENT("KA Hyper Chassis", /obj/item/borg/upgrade/modkit/chassis_mod/orange, 500),
EQUIPMENT("KA Minebot Passthrough", /obj/item/borg/upgrade/modkit/minebot_passthrough, 300),
EQUIPMENT("KA Range Increase", /obj/item/borg/upgrade/modkit/range, 1500),
EQUIPMENT("KA Super Chassis", /obj/item/borg/upgrade/modkit/chassis_mod, 300),
EQUIPMENT("KA Hardness Increase", /obj/item/borg/upgrade/modkit/hardness, 2500),
EQUIPMENT("KA Offensive Mining Explosion", /obj/item/borg/upgrade/modkit/aoe/turfs/andmobs, 3000),
EQUIPMENT("KA Rapid Repeater", /obj/item/borg/upgrade/modkit/cooldown/repeater, 2000),
EQUIPMENT("KA Resonator Blast", /obj/item/borg/upgrade/modkit/resonator_blasts, 2000),
EQUIPMENT("KA Minebot Passthrough", /obj/item/borg/upgrade/modkit/minebot_passthrough, 300),
EQUIPMENT("KA Super Chassis", /obj/item/borg/upgrade/modkit/chassis_mod, 300),
EQUIPMENT("KA Hyper Chassis", /obj/item/borg/upgrade/modkit/chassis_mod/orange, 500),
EQUIPMENT("KA White Tracer Rounds", /obj/item/borg/upgrade/modkit/tracer, 250),
)
prize_list["Digging Tools"] = list(
Expand All @@ -95,7 +98,7 @@
EQUIPMENT("Nanotrasen Minebot", /obj/item/mining_drone_cube, 800),
EQUIPMENT("Minebot AI Upgrade", /obj/item/slimepotion/sentience/mining, 1000),
EQUIPMENT("Minebot Armor Upgrade", /obj/item/mine_bot_upgrade/health, 400),
EQUIPMENT("Minebot Cooldown Upgrade", /obj/item/borg/upgrade/modkit/cooldown/minebot, 600),
EQUIPMENT("Minebot Cooldown Upgrade", /obj/item/borg/upgrade/modkit/cooldown/haste/minebot, 600),
EQUIPMENT("Minebot Melee Upgrade", /obj/item/mine_bot_upgrade, 400),
)
prize_list["Miscellaneous"] = list(
Expand Down
8 changes: 3 additions & 5 deletions code/modules/mining/minebot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@
/mob/living/simple_animal/hostile/mining_drone/death(gibbed)
DropOre(0)
if(stored_gun)
for(var/obj/item/borg/upgrade/modkit/M in stored_gun.modkits)
M.uninstall(stored_gun)
stored_gun.deattach_modkits()
deathmessage = "blows apart!"
. = ..()

Expand All @@ -149,9 +148,8 @@
if(istype(mover, /obj/item/projectile/kinetic))
var/obj/item/projectile/kinetic/projectile = mover
if(projectile.kinetic_gun)
for(var/obj/item/borg/upgrade/modkit/upgrade as anything in projectile.kinetic_gun.get_modkits())
if(istype(upgrade, /obj/item/borg/upgrade/modkit/minebot_passthrough))
return TRUE
for(var/obj/item/borg/upgrade/modkit/minebot_passthrough/MK in projectile.kinetic_gun.get_modkits())
return TRUE

if(istype(mover, /obj/item/projectile/destabilizer))
return TRUE
Expand Down
21 changes: 11 additions & 10 deletions code/modules/mob/living/silicon/robot/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,10 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
icon_state = "robot"
custom_panel = null
module.remove_subsystems_and_actions(src)

for(var/obj/item/borg/upgrade/upgrade in upgrades) //remove all upgrades, cuz we reseting
qdel(upgrade)

QDEL_NULL(module)

camera?.network.Remove(list("Engineering", "Medical", "Mining Outpost"))
Expand All @@ -558,9 +562,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
robot_module_hat_offset(icon_state)
drop_hat()

for(var/obj/item/borg/upgrade/upgrade in upgrades) //remove all upgrades, cuz we reseting
qdel(upgrade)

add_language(LANGUAGE_BINARY, 1)
status_flags |= CANPUSH

Expand Down Expand Up @@ -834,19 +835,17 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
else
to_chat(user, "<span class='warning'>Access denied.</span>")

else if(istype(W, /obj/item/borg/upgrade/))
else if(istype(W, /obj/item/borg/upgrade))
var/obj/item/borg/upgrade/U = W
if(!opened)
to_chat(user, "<span class='warning'>You must access the borg's internals!</span>")
else if(!src.module && U.require_module)
to_chat(user, "<span class='warning'>The borg must choose a module before it can be upgraded!</span>")
else if(U.locked)
to_chat(user, "<span class='warning'>The upgrade is locked and cannot be used yet!</span>")
to_chat(user, span_warning("You must access the borg's internals!"))
else if(!module && U.require_module)
to_chat(user, span_warning("The borg must choose a module before it can be upgraded!"))
else
if(!user.drop_transfer_item_to_loc(W, src))
return
if(U.action(src, user))
user.visible_message("<span class = 'notice'>[user] applied [U] to [src].</span>", "<span class='notice'>You apply [U] to [src].</span>")
user.visible_message(span_notice("[user] applied [U] to [src]."), span_notice("You apply [U] to [src]."))
install_upgrade(U)
module?.fix_modules() //Set up newly added items with NODROP flag.
else
Expand All @@ -867,11 +866,13 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
to_chat(src, "<span class='notice'>MMI radio capability installed.</span>")
mmi.install_radio()
qdel(W)

else if(istype(W, /obj/item/clockwork/clockslab) && isclocker(src) && isclocker(user) && src != user)
locked = !locked
to_chat(user, "You [ locked ? "lock" : "unlock"] [src]'s interface.")
to_chat(src, "<span class='notice'>[user] [ locked ? "locked" : "unlocked"] your interface.</span>")
update_icons()

else
return ..()

Expand Down
12 changes: 6 additions & 6 deletions code/modules/mob/living/silicon/robot/robot_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -570,19 +570,19 @@

// Readd the normal drill
/obj/item/robot_module/miner/unemag()
for(var/obj/item/pickaxe/drill/cyborg/diamond/drill in modules)
for(var/obj/item/pickaxe/drill/cyborg/diamond/drill in modules)
qdel(drill)
modules -= drill
modules += new /obj/item/pickaxe/drill/cyborg(src)
rebuild()
return ..()

/obj/item/robot_module/miner/handle_custom_removal(component_id, mob/living/user, obj/item/W)
if(component_id == "KA modkits")
for(var/obj/item/gun/energy/kinetic_accelerator/cyborg/D in src)
D.attackby(W, user)
return TRUE
return ..()
if(component_id == "KA modkits")
for(var/obj/item/gun/energy/kinetic_accelerator/cyborg/D in src)
W.melee_attack_chain(user, D)
return TRUE
return ..()

/obj/item/robot_module/deathsquad
name = "Deathsquad"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
if(prob(30))
r_pocket = pickweight(list(/obj/item/stack/marker_beacon = 20, /obj/item/stack/spacecash/c1000 = 7, /obj/item/reagent_containers/hypospray/autoinjector/survival = 2, /obj/item/borg/upgrade/modkit/damage = 1 ))
if(prob(10))
l_pocket = pickweight(list(/obj/item/stack/spacecash/c1000 = 7, /obj/item/reagent_containers/hypospray/autoinjector/survival = 2, /obj/item/borg/upgrade/modkit/cooldown = 1 ))
l_pocket = pickweight(list(/obj/item/stack/spacecash/c1000 = 7, /obj/item/reagent_containers/hypospray/autoinjector/survival = 2, /obj/item/borg/upgrade/modkit/cooldown/haste = 1 ))
if("Ashwalker")
mob_species = /datum/species/unathi/ashwalker
uniform = /obj/item/clothing/under/ash_walker
Expand Down
Loading

0 comments on commit 227bccb

Please sign in to comment.