-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nebbaymechs as Exosuits, Legally Distinct from Mechas, obviously. #8956
Open
Mechoid
wants to merge
16
commits into
PolarisSS13:master
Choose a base branch
from
Mechoid:NebbayMechsIMeanExosuits
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,865
−95
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c54784f
Work on porting baymechs as exosuits, legally distinct from Mechs. Fo…
Mechoid 91d61d5
Continued. Neb icons acquired as variants. Fix quirk in handling as a…
Mechoid 267049b
fixfix
Mechoid f94ea0c
Linter to the rescue.
Mechoid 09e0996
get_cell()
Mechoid 7656faf
Exosuits can charge.
Mechoid b5b45f6
A control modules
Mechoid ecd0210
linter sacrifice
Mechoid 557b853
Move Intent Update
Mechoid a56bbb6
Initialize should return.
Mechoid bbbd9da
crouching user hidden sleep
Mechoid 91fd698
Wreckage spawning no longer has a sleep.
Mechoid 4118aba
The great PR review alignment.
Mechoid b8538ed
Magic number and null-loc.
Mechoid d3a6e55
Mousedrag and component damage state calculation.
Mechoid e6f15eb
Dreamchecker
Mechoid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
//If we intercept it return true else return false | ||
/atom/proc/RelayMouseDrag(src_object, over_object, src_location, over_location, src_control, over_control, params, var/mob/user) | ||
return FALSE | ||
|
||
/mob/proc/OnMouseDrag(src_object, over_object, src_location, over_location, src_control, over_control, params) | ||
if(istype(loc, /atom)) | ||
var/atom/A = loc | ||
if(A.RelayMouseDrag(src_object, over_object, src_location, over_location, src_control, over_control, params, src)) | ||
return | ||
|
||
if(over_object && !incapacitated()) | ||
var/obj/item/gun/gun = get_active_hand() | ||
if(istype(gun) && gun.can_autofire()) | ||
set_dir(get_dir(src, over_object)) | ||
gun.Fire(get_turf(over_object), src, params, (get_dist(over_object, src) <= 1), FALSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
GLOBAL_DATUM_INIT(default_hardpoint_background, /image, null) | ||
GLOBAL_DATUM_INIT(hardpoint_error_icon, /image, null) | ||
GLOBAL_DATUM_INIT(hardpoint_bar_empty, /image, null) | ||
|
||
GLOBAL_LIST_INIT(hardpoint_bar_cache, new) | ||
GLOBAL_LIST_INIT(mech_damage_overlay_cache, new) | ||
GLOBAL_LIST_INIT(mech_image_cache, new) | ||
GLOBAL_LIST_INIT(mech_icon_cache, new) | ||
GLOBAL_LIST_INIT(mech_weapon_overlays, icon_states('icons/mob/mecha/mech_weapon_overlays.dmi')) | ||
|
||
#define HARDPOINT_BACK "back" | ||
#define HARDPOINT_LEFT_HAND "left hand" | ||
#define HARDPOINT_RIGHT_HAND "right hand" | ||
#define HARDPOINT_LEFT_SHOULDER "left shoulder" | ||
#define HARDPOINT_RIGHT_SHOULDER "right shoulder" | ||
#define HARDPOINT_HEAD "head" | ||
|
||
// No software required: taser. light, radio. | ||
#define MECH_SOFTWARE_UTILITY "utility equipment" // Plasma torch, clamp, drill. | ||
#define MECH_SOFTWARE_MEDICAL "medical support systems" // Sleeper. | ||
#define MECH_SOFTWARE_WEAPONS "standard weapon systems" // Ballistics and energy weapons. | ||
#define MECH_SOFTWARE_ADVWEAPONS "advanced weapon systems" // Railguns, missile launcher. | ||
#define MECH_SOFTWARE_ENGINEERING "advanced engineering systems" // RCD. | ||
|
||
// EMP damage points before various effects occur. | ||
#define EMP_GUI_DISRUPT 5 // 1 ion rifle shot == 8. | ||
#define EMP_MOVE_DISRUPT 10 // 2 shots. | ||
#define EMP_ATTACK_DISRUPT 20 // 3 shots. | ||
|
||
//About components | ||
#define MECH_COMPONENT_DAMAGE_UNDAMAGED 1 | ||
#define MECH_COMPONENT_DAMAGE_DAMAGED 2 | ||
#define MECH_COMPONENT_DAMAGE_DAMAGED_BAD 3 | ||
#define MECH_COMPONENT_DAMAGE_DAMAGED_TOTAL 4 | ||
|
||
//Construction | ||
#define EXOFRAME_REINFORCED 1 | ||
#define EXOFRAME_REINFORCED_SECURE 2 | ||
#define EXOFRAME_REINFORCED_WELDED 3 | ||
|
||
#define EXOFRAME_WIRED 1 | ||
#define EXOFRAME_WIRED_ADJUSTED 2 | ||
|
||
#define BAR_CAP 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
/obj/item/mech_component | ||
icon = 'icons/mob/mecha/mech_parts_held.dmi' | ||
w_class = ITEMSIZE_HUGE | ||
gender = PLURAL | ||
color = COLOR_GUNMETAL | ||
|
||
var/on_mech_icon = 'icons/mob/mecha/mech_parts.dmi' | ||
var/exosuit_desc_string | ||
var/total_damage = 0 | ||
var/brute_damage = 0 | ||
var/burn_damage = 0 | ||
var/max_damage = 60 | ||
var/damage_state = MECH_COMPONENT_DAMAGE_UNDAMAGED | ||
var/list/has_hardpoints = list() | ||
var/decal | ||
var/power_use = 0 | ||
matter = list(MATERIAL_STEEL = 15000, MATERIAL_PLASTIC = 1000, MATERIAL_OSMIUM = 500) | ||
dir = SOUTH | ||
|
||
/obj/item/mech_component/proc/query_color(var/mob/living/user) | ||
if(istype(user)) | ||
var/input = input("Modify part color:", "Color", color) as color|null | ||
if(input) | ||
return set_colour(input) | ||
|
||
/obj/item/mech_component/proc/set_colour(new_colour) | ||
var/last_colour = color | ||
color = new_colour | ||
return color != last_colour | ||
|
||
/obj/item/mech_component/emp_act(var/severity) | ||
take_burn_damage(rand((10 - (severity*3)),15-(severity*4))) | ||
for(var/obj/item/thing in contents) | ||
thing.emp_act(severity) | ||
|
||
/obj/item/mech_component/examine(mob/user) | ||
. = ..() | ||
if(ready_to_install()) | ||
. += SPAN_NOTICE("It is ready for installation.") | ||
else | ||
. += show_missing_parts(user) | ||
|
||
//These icons have multiple directions but before they're attached we only want south. | ||
/obj/item/mech_component/set_dir() | ||
..(SOUTH) | ||
|
||
/obj/item/mech_component/proc/show_missing_parts(var/mob/user) | ||
return | ||
|
||
/obj/item/mech_component/proc/prebuild() | ||
return | ||
|
||
/obj/item/mech_component/proc/install_component(var/obj/item/thing, var/mob/user) | ||
if(!user.unEquip(thing, src)) | ||
return FALSE | ||
user.visible_message(SPAN_NOTICE("\The [user] installs \the [thing] in \the [src].")) | ||
thing.forceMove(src) | ||
update_components() | ||
return TRUE | ||
|
||
/obj/item/mech_component/proc/update_health() | ||
total_damage = min(max_damage, brute_damage + burn_damage) | ||
damage_state = between(MECH_COMPONENT_DAMAGE_UNDAMAGED, round((total_damage/max_damage) * 4), MECH_COMPONENT_DAMAGE_DAMAGED_TOTAL) | ||
|
||
/obj/item/mech_component/proc/ready_to_install() | ||
return TRUE | ||
|
||
/obj/item/mech_component/proc/repair_brute_damage(var/amt) | ||
take_brute_damage(-amt) | ||
|
||
/obj/item/mech_component/proc/repair_burn_damage(var/amt) | ||
take_burn_damage(-amt) | ||
|
||
/obj/item/mech_component/proc/take_brute_damage(var/amt) | ||
brute_damage = max(0, brute_damage + amt) | ||
update_health() | ||
if(total_damage == max_damage) | ||
take_component_damage(amt,0) | ||
|
||
/obj/item/mech_component/proc/take_burn_damage(var/amt) | ||
burn_damage = max(0, burn_damage + amt) | ||
update_health() | ||
if(total_damage == max_damage) | ||
take_component_damage(0,amt) | ||
|
||
/obj/item/mech_component/proc/take_component_damage(var/brute, var/burn) | ||
var/list/damageable_components = list() | ||
for(var/obj/item/robot_parts/robot_component/RC in contents) | ||
damageable_components += RC | ||
if(!damageable_components.len) return | ||
var/obj/item/robot_parts/robot_component/RC = pick(damageable_components) | ||
if(RC.take_damage(brute, burn)) | ||
qdel(RC) | ||
update_components() | ||
|
||
/obj/item/mech_component/attackby(var/obj/item/thing, var/mob/user) | ||
if(thing.has_tool_quality(TOOL_SCREWDRIVER)) | ||
if(contents.len) | ||
var/obj/item/removed = input("Which component would you like to remove") as null|anything in contents | ||
if(!removed) | ||
return | ||
user.visible_message(SPAN_NOTICE("\The [user] removes \the [removed] from \the [src].")) | ||
removed.forceMove(user.loc) | ||
playsound(user.loc, 'sound/effects/pop.ogg', 50, 0) | ||
update_components() | ||
else | ||
to_chat(user, SPAN_WARNING("There is nothing to remove.")) | ||
return | ||
if(istype(thing, /obj/item/weldingtool)) | ||
repair_brute_generic(thing, user) | ||
return | ||
if(istype(thing, /obj/item/stack/cable_coil)) | ||
repair_burn_generic(thing, user) | ||
return | ||
|
||
if(thing.has_tool_quality(TOOL_MULTITOOL)) | ||
query_color(user) | ||
return | ||
|
||
return ..() | ||
|
||
/obj/item/mech_component/proc/update_components() | ||
return | ||
|
||
/obj/item/mech_component/proc/repair_brute_generic(var/obj/item/weldingtool/WT, var/mob/user) | ||
if(!istype(WT)) | ||
return | ||
if(!brute_damage) | ||
to_chat(user, SPAN_NOTICE("You inspect \the [src] but find nothing to repair.")) | ||
return | ||
if(!WT.welding) | ||
to_chat(user, SPAN_WARNING("Turn \the [WT] on, first.")) | ||
return | ||
if(WT.remove_fuel(1, user)) | ||
if(do_after(user, 10, src) && brute_damage) | ||
repair_brute_damage(10) | ||
to_chat(user, SPAN_NOTICE("You mend the damage to \the [src].")) | ||
playsound(user.loc, 'sound/items/Welder.ogg', 25, 1) | ||
|
||
/obj/item/mech_component/proc/repair_burn_generic(var/obj/item/stack/cable_coil/CC, var/mob/user) | ||
if(!istype(CC)) | ||
return | ||
if(!burn_damage) | ||
to_chat(user, SPAN_NOTICE("\The [src]'s wiring doesn't need replacing.")) | ||
return | ||
|
||
if(CC.get_amount() < 6) | ||
to_chat(user, SPAN_WARNING("You need at least 6 units of cable to repair this section.")) | ||
return | ||
|
||
user.visible_message("\The [user] begins replacing the wiring of \the [src]...") | ||
|
||
if(do_after(user, 10, src) && burn_damage) | ||
if(QDELETED(CC) || QDELETED(src) || !CC.use(6)) | ||
return | ||
|
||
repair_burn_damage(25) | ||
to_chat(user, SPAN_NOTICE("You mend the damage to \the [src]'s wiring.")) | ||
playsound(user.loc, 'sound/items/Deconstruct.ogg', 25, 1) | ||
return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/obj/item/robot_parts/robot_component/armour/exosuit | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. File organization: Can we split the folders for |
||
name = "exosuit armour plating" | ||
armor = list( | ||
melee = 70, | ||
bullet = 30, | ||
laser = 40, | ||
energy = 10, | ||
bomb = 30, | ||
bio = 100, | ||
rad = 20 | ||
) | ||
origin_tech = list(TECH_MATERIAL = 1) | ||
|
||
/obj/item/robot_parts/robot_component/armour/exosuit/radproof | ||
name = "radiation-proof armour plating" | ||
desc = "A fully enclosed radiation hardened shell designed to protect the pilot from radiation" | ||
armor = list( | ||
melee = 70, | ||
bullet = 30, | ||
laser = 40, | ||
energy = 10, | ||
bomb = 30, | ||
bio = 100, | ||
rad = 100 | ||
) | ||
origin_tech = list(TECH_MATERIAL = 3) | ||
|
||
/obj/item/robot_parts/robot_component/armour/exosuit/em | ||
name = "EM-shielded armour plating" | ||
desc = "A shielded plating that surrounds the eletronics and protects them from electromagnetic radiation" | ||
armor = list( | ||
melee =70, | ||
bullet = 25, | ||
laser = 25, | ||
energy = 100, | ||
bomb = 10, | ||
bio = 100, | ||
rad = 20 | ||
) | ||
origin_tech = list(TECH_MATERIAL = 3) | ||
|
||
/obj/item/robot_parts/robot_component/armour/exosuit/combat | ||
name = "heavy combat plating" | ||
desc = "Plating designed to deflect incoming attacks and explosions" | ||
armor = list( | ||
melee = 70, | ||
bullet = 60, | ||
laser = 70, | ||
energy = 10, | ||
bomb = 60, | ||
bio = 100, | ||
rad = 20 | ||
) | ||
origin_tech = list(TECH_MATERIAL = 5) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What actually uses
damage_state
? Can we just compute this on the fly? (It smells like an icon state index)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in the health doll for the exosuit UI, looking at the refs