[MIRROR] rigsuit fixes (#10546)

Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-03-29 10:31:28 -07:00
committed by GitHub
parent 902d7ab4fa
commit 972a7f124e
7 changed files with 32 additions and 276 deletions

View File

@@ -1,262 +0,0 @@
/*
* Contains
* /obj/item/rig_module/grenade_launcher
* /obj/item/rig_module/mounted
* /obj/item/rig_module/mounted/taser
* /obj/item/rig_module/shield
* /obj/item/rig_module/fabricator
* /obj/item/rig_module/mounted/energy_blade
* /obj/item/rig_module/device/flash */
/obj/item/rig_module/device/flash
name = "mounted flash"
desc = "You are the law."
icon_state = "flash"
interface_name = "mounted flash"
interface_desc = "Stuns your target by blinding them with a bright light."
device_type = /obj/item/flash
/obj/item/rig_module/grenade_launcher
name = "mounted grenade launcher"
desc = "A shoulder-mounted micro-explosive dispenser."
selectable = 1
icon_state = "grenadelauncher"
interface_name = "integrated grenade launcher"
interface_desc = "Discharges loaded grenades against the wearer's location."
var/fire_force = 30
var/fire_distance = 10
charges = list(
list("flashbang", "flashbang", /obj/item/grenade/flashbang, 3),
list("smoke bomb", "smoke bomb", /obj/item/grenade/smokebomb, 3),
list("EMP grenade", "EMP grenade", /obj/item/grenade/empgrenade, 3),
)
/obj/item/rig_module/grenade_launcher/accepts_item(var/obj/item/input_device, var/mob/living/user)
if(!istype(input_device) || !istype(user))
return 0
var/datum/rig_charge/accepted_item
for(var/charge in charges)
var/datum/rig_charge/charge_datum = charges[charge]
if(input_device.type == charge_datum.product_type)
accepted_item = charge_datum
break
if(!accepted_item)
return 0
if(accepted_item.charges >= 5)
to_chat(user, span_danger("Another grenade of that type will not fit into the module."))
return 0
to_chat(user, span_boldnotice("You slot \the [input_device] into the suit module."))
user.drop_from_inventory(input_device)
qdel(input_device)
accepted_item.charges++
return 1
/obj/item/rig_module/grenade_launcher/engage(atom/target)
if(!..())
return 0
if(!target)
return 0
var/mob/living/carbon/human/H = holder.wearer
if(!charge_selected)
to_chat(H, span_danger("You have not selected a grenade type."))
return 0
var/datum/rig_charge/charge = charges[charge_selected]
if(!charge)
return 0
if(charge.charges <= 0)
to_chat(H, span_danger("Insufficient grenades!"))
return 0
charge.charges--
var/obj/item/grenade/new_grenade = new charge.product_type(get_turf(H))
H.visible_message(span_danger("[H] launches \a [new_grenade]!"))
new_grenade.activate(H)
new_grenade.throw_at(target,fire_force,fire_distance)
/obj/item/rig_module/grenade_launcher/smoke
name = "mounted smoke-bomb launcher"
desc = "A shoulder-mounted smoke-bomb dispenser."
interface_name = "integrated smoke-bomb launcher"
interface_desc = "Discharges loaded smoke-bombs against the wearer's location."
fire_force = 15
charges = list(
list("smoke bomb", "smoke bomb", /obj/item/grenade/smokebomb, 6)
)
/obj/item/rig_module/mounted
name = "mounted laser cannon"
desc = "A shoulder-mounted battery-powered laser cannon mount."
selectable = 1
usable = 1
module_cooldown = 0
icon_state = "lcannon"
engage_string = "Configure"
interface_name = "mounted laser cannon"
interface_desc = "A shoulder-mounted cell-powered laser cannon."
var/gun_type = /obj/item/gun/energy/lasercannon/mounted
var/obj/item/gun/gun
/obj/item/rig_module/mounted/Initialize(mapload)
. = ..()
gun = new gun_type(src)
/obj/item/rig_module/mounted/engage(atom/target)
if(!..())
return 0
if(!target)
gun.attack_self(holder.wearer)
return
gun.Fire(target,holder.wearer)
return 1
/obj/item/rig_module/mounted/egun
name = "mounted energy gun"
desc = "A forearm-mounted energy projector."
icon_state = "egun"
interface_name = "mounted energy gun"
interface_desc = "A forearm-mounted suit-powered energy gun."
gun_type = /obj/item/gun/energy/gun/mounted
/obj/item/rig_module/mounted/taser
name = "mounted taser"
desc = "A palm-mounted nonlethal energy projector."
icon_state = "taser"
usable = 0
suit_overlay_active = "mounted-taser"
suit_overlay_inactive = "mounted-taser"
interface_name = "mounted taser"
interface_desc = "A shoulder-mounted cell-powered taser."
gun_type = /obj/item/gun/energy/taser/mounted
/obj/item/rig_module/mounted/energy_blade
name = "energy blade projector"
desc = "A powerful cutting beam projector."
icon_state = "eblade"
activate_string = "Project Blade"
deactivate_string = "Cancel Blade"
interface_name = "spider fang blade"
interface_desc = "A lethal energy projector that can shape a blade projected from the hand of the wearer or launch radioactive darts."
usable = 0
selectable = 1
toggleable = 1
use_power_cost = 50
active_power_cost = 10
passive_power_cost = 0
gun_type = /obj/item/gun/energy/crossbow/ninja
/obj/item/rig_module/mounted/energy_blade/process()
if(holder && holder.wearer)
if(!(locate(/obj/item/melee/energy/blade) in holder.wearer))
deactivate()
return 0
return ..()
/obj/item/rig_module/mounted/energy_blade/activate()
..()
var/mob/living/M = holder.wearer
if(M.l_hand && M.r_hand)
to_chat(M, span_danger("Your hands are full."))
deactivate()
return
var/obj/item/melee/energy/blade/blade = new(M)
blade.creator = M
M.put_in_hands(blade)
/obj/item/rig_module/mounted/energy_blade/deactivate()
..()
var/mob/living/M = holder.wearer
if(!M)
return
for(var/obj/item/melee/energy/blade/blade in M.contents)
M.drop_from_inventory(blade)
qdel(blade)
/obj/item/rig_module/fabricator
name = "matter fabricator"
desc = "A self-contained microfactory system for hardsuit integration."
selectable = 1
usable = 1
use_power_cost = 15
icon_state = "enet"
engage_string = "Fabricate Star"
interface_name = "death blossom launcher"
interface_desc = "An integrated microfactory that produces poisoned throwing stars from thin air and electricity."
var/fabrication_type = /obj/item/material/star/ninja
var/fire_force = 30
var/fire_distance = 10
/obj/item/rig_module/fabricator/engage(atom/target)
if(!..())
return 0
var/mob/living/H = holder.wearer
if(target)
var/obj/item/firing = new fabrication_type()
firing.forceMove(get_turf(src))
H.visible_message(span_danger("[H] launches \a [firing]!"))
firing.throw_at(target,fire_force,fire_distance)
else
if(H.l_hand && H.r_hand)
to_chat(H, span_danger("Your hands are full."))
else
var/obj/item/new_weapon = new fabrication_type()
new_weapon.forceMove(H)
to_chat(H, span_boldnotice("You quickly fabricate \a [new_weapon]."))
H.put_in_hands(new_weapon)
return 1

View File

@@ -18,6 +18,7 @@
/obj/item/rig_module/mounted/Initialize(mapload)
. = ..()
gun = new gun_type(src)
gun.mounted_gun = TRUE
/obj/item/rig_module/mounted/engage(atom/target)

View File

@@ -70,6 +70,7 @@
// Rig status vars.
var/open = 0 // Access panel status.
var/locked = 1 // Lock status.
var/unremovable = FALSE //If the rig can be removed or not. Used for protean rigs.
var/subverted = 0
var/interface_locked = 0
var/control_overridden = 0
@@ -185,6 +186,11 @@
spark_system = null
return ..()
/obj/item/rig/MouseDrop(obj/over_object)
if(unremovable)
return
..()
/obj/item/rig/examine(mob/user)
. = ..()
if(wearer)

View File

@@ -5,6 +5,7 @@
name = "nanosuit control cluster"
suit_type = "nanomachine"
icon = 'icons/obj/rig_modules_vr.dmi'
unremovable = TRUE //Can not be removed. At least, not initially.
default_mob_icon = null //Actually having a forced sprite for Proteans is ugly af. I'm not gonna make this a toggle
icon_state = "nanomachine_rig"
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 100, rad = 100)
@@ -19,14 +20,13 @@
boot_type = /obj/item/clothing/shoes/magboots/rig/protean
chest_type = /obj/item/clothing/suit/space/rig/protean
glove_type = /obj/item/clothing/gloves/gauntlets/rig/protean
protean = 1
offline_vision_restriction = 0
open = 1
protean = TRUE
offline_vision_restriction = FALSE
open = TRUE
cell_type = /obj/item/cell/protean
var/dead = 0
var/dead = 0 //This can be greater than 1.
//interface_path = "RIGSuit_protean"
//ai_interface_path = "RIGSuit_protean"
var/sealed = 0
var/assimilated_rig
var/can_assimilate_rig = TRUE // CHOMPEdit
@@ -37,11 +37,11 @@
/obj/item/rig/protean/check_suit_access(mob/living/user)
if(user == myprotean)
return 1
return TRUE
return ..()
/obj/item/rig/protean/digest_act(atom/movable/item_storage = null)
return 0
return FALSE
/obj/item/rig/protean/ex_act(severity)
return
@@ -452,9 +452,9 @@
/obj/item/rig/protean/equipped(mob/living/carbon/human/M)
..()
if(dead)
canremove = 1
unremovable = FALSE
else
canremove = 0
unremovable = TRUE //It's like glue! If you put them on your back, YOU can't take them off!
/obj/item/rig/protean/ai_can_move_suit(mob/user, check_user_module = 0, check_for_ai = 0)
if(check_for_ai)
@@ -584,7 +584,12 @@
to_chat(usr, "[src] has not assimilated a RIG. Use one on it to assimilate.")
/obj/item/rig/protean/MouseDrop(obj/over_object as obj)
if(!canremove)
if(dead) //We adjust our unremovable upon being attempted to be moved via checking if we are dead or not.
unremovable = FALSE
else
unremovable = TRUE
if(unremovable)
return
if (isliving(usr) || isobserver(usr))

View File

@@ -22,7 +22,7 @@ So here it sits, snowflake code for a single item.
data["ai"] = FALSE
data["cooling"] = cooling_on
data["sealed"] = !sealed
data["sealed"] = !canremove
data["sealing"] = sealing
data["helmet"] = (helmet ? "[helmet.name]" : "None.")
data["gauntlets"] = (gloves ? "[gloves.name]" : "None.")

View File

@@ -95,6 +95,7 @@
var/last_shot = 0 //records the last shot fired
var/recoil_mode = 1 //If the gun will hurt micros if shot or not. Disabled on Virgo, used downstream. //CHOMPEDIT - Enabled
var/mounted_gun = 0 //If the gun is mounted within a rigsuit or elsewhere. This makes it so the gun can be shot even if it's loc != a mob
//VOREStation Add - /tg/ icon system
var/charge_sections = 4
@@ -340,8 +341,10 @@
src.add_fingerprint(usr)
/obj/item/gun/proc/Fire(atom/target, mob/living/user, clickparams, pointblank=0, reflex=0)
if(!user || !target) return
if(target.z != user.z) return
if(!user || !target)
return
if(target.z != user.z)
return
add_fingerprint(user)
@@ -369,7 +372,7 @@
SHOULD_NOT_OVERRIDE(TRUE)
if(ticker > burst)
return //we're done here
if(!ismob(loc)) //We've been dropped.
if(!ismob(loc) && !mounted_gun) //We've been dropped and we are NOT a mounted gun.
return
if(user.stat) //We've been KO'd or have died. No shooting while dead.
return

View File

@@ -89,6 +89,9 @@ function removeStatusTab(name) {
verb_tabs.splice(i, 1);
}
}
if(current_tab == name) {
tab_change("Status");
}
menu.removeChild(document.getElementById(name));
TakeTabFromByond(name);
}