Skip to content
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

combat refactoring part 1: armor / damage / materials #6575

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,9 @@
#include "code\game\content\factions\orion\iwl\head.dm"
#include "code\game\content\factions\orion\iwl\suits.dm"
#include "code\game\content\factions\orion\iwl\uniform.dm"
#include "code\game\content\factions\special\special.dm"
#include "code\game\content\factions\special\scorian\scorian-faction.dm"
#include "code\game\content\factions\special\scorian\items\scorian-melee-weapons.dm"
#include "code\game\content\locations\frontier.dm"
#include "code\game\dna\dna2.dm"
#include "code\game\dna\dna2_domutcheck.dm"
Expand Down Expand Up @@ -3487,22 +3490,22 @@
#include "code\modules\mob\floating_message.dm"
#include "code\modules\mob\gender.dm"
#include "code\modules\mob\grab.dm"
#include "code\modules\mob\health.dm"
#include "code\modules\mob\hear_say.dm"
#include "code\modules\mob\holder.dm"
#include "code\modules\mob\inventory.dm"
#include "code\modules\mob\life.dm"
#include "code\modules\mob\login.dm"
#include "code\modules\mob\logout.dm"
#include "code\modules\mob\mob-damage.dm"
#include "code\modules\mob\mob-defense.dm"
#include "code\modules\mob\mob-health.dm"
#include "code\modules\mob\mob-keybind-triggers.dm"
#include "code\modules\mob\mob-life.dm"
#include "code\modules\mob\mob-mobility.dm"
#include "code\modules\mob\mob.dm"
#include "code\modules\mob\mob_defines.dm"
#include "code\modules\mob\mob-iff.dm"
#include "code\modules\mob\mob_helpers.dm"
#include "code\modules\mob\mob_transformation_simple.dm"
#include "code\modules\mob\mobility.dm"
#include "code\modules\mob\movement.dm"
#include "code\modules\mob\perspective.dm"
#include "code\modules\mob\physiology.dm"
Expand Down Expand Up @@ -3573,13 +3576,13 @@
#include "code\modules\mob\living\living-damage.dm"
#include "code\modules\mob\living\living-defense-legacy.dm"
#include "code\modules\mob\living\living-defense.dm"
#include "code\modules\mob\living\living-mobility.dm"
#include "code\modules\mob\living\living.dm"
#include "code\modules\mob\living\living_defines.dm"
#include "code\modules\mob\living\living_powers.dm"
#include "code\modules\mob\living\living_vr.dm"
#include "code\modules\mob\living\login.dm"
#include "code\modules\mob\living\logout.dm"
#include "code\modules\mob\living\mobility.dm"
#include "code\modules\mob\living\movement.dm"
#include "code\modules\mob\living\offense.dm"
#include "code\modules\mob\living\organs.dm"
Expand All @@ -3603,8 +3606,8 @@
#include "code\modules\mob\living\bot\SLed209bot.dm"
#include "code\modules\mob\living\carbon\breathe.dm"
#include "code\modules\mob\living\carbon\carbon-defense.dm"
#include "code\modules\mob\living\carbon\carbon-defense_legacy.dm"
#include "code\modules\mob\living\carbon\carbon.dm"
#include "code\modules\mob\living\carbon\carbon_defense.dm"
#include "code\modules\mob\living\carbon\carbon_defines.dm"
#include "code\modules\mob\living\carbon\carbon_movement.dm"
#include "code\modules\mob\living\carbon\carbon_powers.dm"
Expand Down
50 changes: 25 additions & 25 deletions code/__DEFINES/combat/armor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,49 +88,49 @@ GLOBAL_REAL_LIST(armor_types) = list(

//? melee

#define MELEE_TIER_DEFAULT MELEE_TIER_MEDIUM
#define MELEE_TIER_UNARMED_DEFAULT ARMOR_TIER_LAUGHABLE
#define MELEE_TIER_UNARMED_FISTS ARMOR_TIER_LAUGHABLE
#define MELEE_TIER_UNARMED_CLAW ARMOR_TIER_LOW
#define MELEE_TIER_LIGHT ARMOR_TIER_BELOW
#define MELEE_TIER_MEDIUM ARMOR_TIER_NORMAL
#define MELEE_TIER_HEAVY ARMOR_TIER_ABOVE
#define MELEE_TIER_EXTREME ARMOR_TIER_HIGH

#define MELEE_TIER_UNARMED_DEFAULT ARMOR_TIER_LOW
#define MELEE_TIER_UNARMED_FISTS ARMOR_TIER_LOW
#define MELEE_TIER_UNARMED_CLAW ARMOR_TIER_BELOW
#define MELEE_TIER_LIGHT ARMOR_TIER_BASELINE
#define MELEE_TIER_MEDIUM ARMOR_TIER_ABOVE
#define MELEE_TIER_HEAVY ARMOR_TIER_HIGH
#define MELEE_TIER_EXTREME ARMOR_TIER_OVERWHELMING
#define MELEE_TIER_DEFAULT MELEE_TIER_MEDIUM

//? bullet

#define BULLET_TIER_DEFAULT BULLET_TIER_MEDIUM

/// super improvised rounds / pistols / whatever.
#define BULLET_TIER_LAUGHABLE ARMOR_TIER_BELOW
#define BULLET_TIER_LAUGHABLE ARMOR_TIER_LOW
/// pistols
#define BULLET_TIER_LOW ARMOR_TIER_BASELINE
/// smgs
#define BULLET_TIER_MEDIUM ARMOR_TIER_ABOVE
#define BULLET_TIER_LOW ARMOR_TIER_BELOW
/// heavy pistols, light rifles
#define BULLET_TIER_MEDIUM ARMOR_TIER_NORMAL
/// rifles
#define BULLET_TIER_HIGH ARMOR_TIER_HIGH
#define BULLET_TIER_HIGH ARMOR_TIER_ABOVE
/// lmgs, light mech weapons
#define BULLET_TIER_EXTREME ARMOR_TIER_OVERWHELMING
#define BULLET_TIER_EXTREME ARMOR_TIER_HIGH
/// heavy mech weapons
#define BULLET_TIER_RIDICULOUS ARMOR_TIER_RIDICULOUS
#define BULLET_TIER_RIDICULOUS ARMOR_TIER_OVERWHELMING

//? laser
#define BULLET_TIER_DEFAULT ARMOR_TIER_NORMAL

#define LASER_TIER_DEFAULT LASER_TIER_MEDIUM
//? laser

/// improvised laser focis / etc
#define LASER_TIER_LAUGHABLE ARMOR_TIER_BELOW
#define LASER_TIER_LAUGHABLE ARMOR_TIER_LOW
/// low tier lasers
#define LASER_TIER_LOW ARMOR_TIER_BASELINE
#define LASER_TIER_LOW ARMOR_TIER_BELOW
/// laser carbines, energy guns, etc
#define LASER_TIER_MEDIUM ARMOR_TIER_ABOVE
#define LASER_TIER_MEDIUM ARMOR_TIER_NORMAL
/// x-ray rifles, snipers
#define LASER_TIER_HIGH ARMOR_TIER_HIGH
#define LASER_TIER_HIGH ARMOR_TIER_ABOVE
/// mech weapons, usualy
#define LASER_TIER_EXTREME ARMOR_TIER_OVERWHELMING
#define LASER_TIER_EXTREME ARMOR_TIER_HIGH
/// power transmission laser?
#define LASER_TIER_RIDICULOUS ARMOR_TIER_RIDICULOUS
#define LASER_TIER_RIDICULOUS ARMOR_TIER_OVERWHELMING

#define LASER_TIER_DEFAULT ARMOR_TIER_NORMAL

//? --- armor calculations ---

Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/combat/damage.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 Citadel Station Developers *//

//? damage types
//? damage types

//* direct damage types; maps to most systems in the game *//

Expand Down
128 changes: 66 additions & 62 deletions code/__DEFINES/inventory/carry_weight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@
//? encumberence - how hard it is to move with an item, non-recursive

//* CHECK https://www.desmos.com/calculator/o44o3naob2 FOR INFORMATION *//
//* DO nOT CHANGE ANY CONSTANTS WItHOUT GRAPHING IT OUT FIRST. *//
//* DO NOT CHANGE ANY CONSTANTS WItHOUT GRAPHING IT OUT FIRST. *//

//? Carry strength - flat strength. you can carry up to this with no penalty.

#define CARRY_STRENGTH_BASELINE 20
/// pretty much the base max(weight, encumbrance) someone can carry
///
/// * congratulations! 35kg is what soldiers carry into combat. you're all soldiers now! (/s)
/// * balance your overpowered gamer gear around this, gamers!
#define CARRY_STRENGTH_BASELINE 35

#define CARRY_STRENGTH_ADD_HUMAN 1.25
#define CARRY_STRENGTH_ADD_UNATHI 2.5
#define CARRY_STRENGTH_ADD_PROTEAN 2.5
#define CARRY_STRENGTH_ADD_MOTH_LIGHT 1.25
#define CARRY_STRENGTH_ADD_HUMAN 1.25 * 1.75
#define CARRY_STRENGTH_ADD_UNATHI 2.5 * 1.75
#define CARRY_STRENGTH_ADD_PROTEAN 2.5 * 1.75
#define CARRY_STRENGTH_ADD_MOTH_LIGHT 1.25 * 1.75
#define CARRY_STRENGTH_ADD_MOTH_DARK 0
#define CARRY_STRENGTH_ADD_TAJARAN 0
#define CARRY_STRENGTH_ADD_TESHARI 0
#define CARRY_STRENGTH_ADD_XENOCHIMERA 2.5
#define CARRY_STRENGTH_ADD_XENOHYBRID 2.5
#define CARRY_STRENGTH_ADD_XENOCHIMERA 2.5 * 1.75
#define CARRY_STRENGTH_ADD_XENOHYBRID 2.5 * 1.75
#define CARRY_STRENGTH_ADD_ALRAUNE 10 //alraune already deal with slowdown, let's give them some big bonus for being slow.
#define CARRY_STRENGTH_ADD_DIONA 20 //hee hoo

Expand All @@ -44,9 +48,9 @@
//? Carry equation constants

/// How penalizing the default penalty curve is; lower is weaker slowdowns from overweight.
#define CARRY_WEIGHT_SCALING 2
#define CARRY_WEIGHT_SCALING 3.5
/// For now, constant - bias factor; higher = skip more of the curve as soon as weight goes above strength
#define CARRY_WEIGHT_BIAS 1.2
#define CARRY_WEIGHT_BIAS 0.6
/// % from 0 to 1 of the curve that is automatically given ; 0.1 = the asymptote is 10%, as opposed to 0% movespeed
#define CARRY_WEIGHT_ASYMPTOTE 0.1

Expand All @@ -56,33 +60,33 @@

//* Armor

#define ITEM_ENCUMBRANCE_ARMOR_ULTRALIGHT 7.5
#define ITEM_ENCUMBRANCE_ARMOR_ULTRALIGHT 7.5 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_LIGHT 10
#define ITEM_ENCUMBRANCE_ARMOR_MEDIUM 15
#define ITEM_ENCUMBRANCE_ARMOR_MEDIUM 15 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_HEAVY 20
#define ITEM_ENCUMBRANCE_ARMOR_SUPERHEAVY 30
#define ITEM_ENCUMBRANCE_ARMOR_SPECIALIZED 15

#define ITEM_ENCUMBRANCE_ARMOR_ULTRALIGHT_HELMET 1
#define ITEM_ENCUMBRANCE_ARMOR_LIGHT_HELMET 1.5
#define ITEM_ENCUMBRANCE_ARMOR_MEDIUM_HELMET 2
#define ITEM_ENCUMBRANCE_ARMOR_HEAVY_HELMET 2.5
#define ITEM_ENCUMBRANCE_ARMOR_SUPERHEAVY_HELMET 3
#define ITEM_ENCUMBRANCE_ARMOR_SPECIALIZED_HELMET 2

#define ITEM_ENCUMBRANCE_ARMOR_ULTRALIGHT_GLOVES 1
#define ITEM_ENCUMBRANCE_ARMOR_LIGHT_GLOVES 2
#define ITEM_ENCUMBRANCE_ARMOR_MEDIUM_GLOVES 3
#define ITEM_ENCUMBRANCE_ARMOR_HEAVY_GLOVES 4
#define ITEM_ENCUMBRANCE_ARMOR_SUPERHEAVY_GLOVES 5
#define ITEM_ENCUMBRANCE_ARMOR_SPECIALIZED_GLOVES 3

#define ITEM_ENCUMBRANCE_ARMOR_ULTRALIGHT_BOOTS 2.5
#define ITEM_ENCUMBRANCE_ARMOR_LIGHT_BOOTS 3.5
#define ITEM_ENCUMBRANCE_ARMOR_MEDIUM_BOOTS 5
#define ITEM_ENCUMBRANCE_ARMOR_HEAVY_BOOTS 7.5
#define ITEM_ENCUMBRANCE_ARMOR_SUPERHEAVY 30 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_SPECIALIZED 15 * 1.75

#define ITEM_ENCUMBRANCE_ARMOR_ULTRALIGHT_HELMET 1 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_LIGHT_HELMET 1.5 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_MEDIUM_HELMET 2 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_HEAVY_HELMET 2.5 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_SUPERHEAVY_HELMET 3 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_SPECIALIZED_HELMET 2 * 1.75

#define ITEM_ENCUMBRANCE_ARMOR_ULTRALIGHT_GLOVES 1 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_LIGHT_GLOVES 2 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_MEDIUM_GLOVES 3 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_HEAVY_GLOVES 4 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_SUPERHEAVY_GLOVES 5 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_SPECIALIZED_GLOVES 3 * 1.75

#define ITEM_ENCUMBRANCE_ARMOR_ULTRALIGHT_BOOTS 2.5 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_LIGHT_BOOTS 3.5 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_MEDIUM_BOOTS 5 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_HEAVY_BOOTS 7.5 * 1.75
#define ITEM_ENCUMBRANCE_ARMOR_SUPERHEAVY_BOOTS 10
#define ITEM_ENCUMBRANCE_ARMOR_SPECIALIZED_BOOTS 5
#define ITEM_ENCUMBRANCE_ARMOR_SPECIALIZED_BOOTS 5 * 1.75

#define ITEM_ENCUMBRANCE_ARMOR_BIORAD_SUIT 30
#define ITEM_ENCUMBRANCE_ARMOR_BIORAD_HELMET 0
Expand All @@ -92,7 +96,7 @@
#define ITEM_ENCUMBRANCE_ARMOR_FIRE_HELMET 0

#define ITEM_ENCUMBRANCE_ARMOR_MEDIEVAL_PLATE 30
#define ITEM_ENCUMBRANCE_ARMOR_MEDIEVAL_CHAIN 25
#define ITEM_ENCUMBRANCE_ARMOR_MEDIEVAL_CHAIN 25 * 1.75

#define ITEM_ENCUMBRANCE_ARMOR_ANOMALY 30
#define ITEM_ENCUMBRANCE_ARMOR_ANOMALY_HELMET 0
Expand All @@ -102,28 +106,28 @@
/// shoecuffs
#define ITEM_ENCUMBRANCE_SHOES_CUFFED 50
/// magboots off
#define ITEM_ENCUMBRANCE_SHOES_MAGBOOTS 5
#define ITEM_ENCUMBRANCE_SHOES_MAGBOOTS 5 * 1.75
/// normal magboots on
#define ITEM_ENCUMBRANCE_SHOES_MAGBOOTS_PULSE 20
/// ce magboots on
#define ITEM_ENCUMBRANCE_SHOES_MAGBOOTS_PULSE_ADVANCED 7.5
#define ITEM_ENCUMBRANCE_SHOES_CLOWN 5
#define ITEM_ENCUMBRANCE_SHOES_FINS 5
#define ITEM_ENCUMBRANCE_SHOES_GALOSHES 5
#define ITEM_ENCUMBRANCE_SHOES_MAGBOOTS_PULSE_ADVANCED 7.5 * 1.75
#define ITEM_ENCUMBRANCE_SHOES_CLOWN 5 * 1.75
#define ITEM_ENCUMBRANCE_SHOES_FINS 5 * 1.75
#define ITEM_ENCUMBRANCE_SHOES_GALOSHES 5 * 1.75

//* Factions

#define ITEM_ENCUMBRANCE_CHANGELING_MAGBOOTS 5
#define ITEM_ENCUMBRANCE_CHANGELING_MAGBOOTS_PULSE 7.5
#define ITEM_ENCUMBRANCE_CULT_VOIDSUIT 35
#define ITEM_ENCUMBRANCE_CULT_VOIDSUIT_HELMET 2.5
#define ITEM_ENCUMBRANCE_CHANGELING_MAGBOOTS 5 * 1.75
#define ITEM_ENCUMBRANCE_CHANGELING_MAGBOOTS_PULSE 7.5 * 1.75
#define ITEM_ENCUMBRANCE_CULT_VOIDSUIT 35 * 1.75
#define ITEM_ENCUMBRANCE_CULT_VOIDSUIT_HELMET 2.5 * 1.75

//* Spacesuits

#define ITEM_ENCUMBRANCE_SOFTSUIT 22.5
#define ITEM_ENCUMBRANCE_SOFTSUIT_HELMET 2.5
#define ITEM_ENCUMBRANCE_SOFTSUIT 22.5 * 1.75
#define ITEM_ENCUMBRANCE_SOFTSUIT_HELMET 2.5 * 1.75

#define ITEM_ENCUMBRANCE_VOIDSUIT 25
#define ITEM_ENCUMBRANCE_VOIDSUIT 25 * 1.75
#define ITEM_ENCUMBRANCE_VOIDSUIT_HELMET 0
#define ITEM_ENCUMBRANCE_VOIDSUIT_LIGHT 20
#define ITEM_ENCUMBRANCE_VOIDSUIT_HELMET_LIGHT 0
Expand All @@ -132,21 +136,21 @@
#define ITEM_ENCUMBRANCE_VOIDSUIT_ULTRALIGHT 20
#define ITEM_ENCUMBRANCE_VOIDSUIT_HELMET_ULTRALIGHT 0

#define ITEM_ENCUMBRANCE_VOIDSUIT_ANOMALY 22.5
#define ITEM_ENCUMBRANCE_VOIDSUIT_ANOMALY_HELMET 2.5
#define ITEM_ENCUMBRANCE_VOIDSUIT_ANOMALY 22.5 * 1.75
#define ITEM_ENCUMBRANCE_VOIDSUIT_ANOMALY_HELMET 2.5 * 1.75

#define ITEM_ENCUMBRANCE_LEGACY_RIG_LIGHT 20
#define ITEM_ENCUMBRANCE_LEGACY_RIG 25
#define ITEM_ENCUMBRANCE_LEGACY_RIG 25 * 1.75
#define ITEM_ENCUMBRANCE_LEGACY_RIG_HEAVY 30

#define ITEM_ENCUMBRANCE_EMERGENCY_SOFTSUIT 25
#define ITEM_ENCUMBRANCE_EMERGENCY_SOFTSUIT 25 * 1.75
#define ITEM_ENCUMBRANCE_EMERGENCY_SOFTSUIT_HELMET 0

//* Storage

#define ITEM_ENCUMBRANCE_STORAGE_BACKPACK 5
#define ITEM_ENCUMBRANCE_STORAGE_DUFFLEBAG 5
#define ITEM_ENCUMBRANCE_STORAGE_POUCH_LARGE 5
#define ITEM_ENCUMBRANCE_STORAGE_BACKPACK 5 * 1.75
#define ITEM_ENCUMBRANCE_STORAGE_DUFFLEBAG 5 * 1.75
#define ITEM_ENCUMBRANCE_STORAGE_POUCH_LARGE 5 * 1.75

//* Species

Expand All @@ -156,18 +160,18 @@

//* Weapons

#define ITEM_ENCUMBRANCE_GUN_LIGHT 1.25
#define ITEM_ENCUMBRANCE_GUN_NORMAL 2.5
#define ITEM_ENCUMBRANCE_GUN_LARGE 5
#define ITEM_ENCUMBRANCE_GUN_BULKY 8
#define ITEM_ENCUMBRANCE_GUN_UNREASONABLE 15
#define ITEM_ENCUMBRANCE_GUN_LIGHT 1.25 * 1.75
#define ITEM_ENCUMBRANCE_GUN_NORMAL 2.5 * 1.75
#define ITEM_ENCUMBRANCE_GUN_LARGE 5 * 1.75
#define ITEM_ENCUMBRANCE_GUN_BULKY 8 * 1.75
#define ITEM_ENCUMBRANCE_GUN_UNREASONABLE 15 * 1.75
#define ITEM_ENCUMBRANCE_GUN_RIDICULOUS 30
#define ITEM_ENCUMBRANCE_GUN_VEHICLE 60

#define ITEM_ENCUMBRANCE_MELEE_SPEAR 7.5
#define ITEM_ENCUMBRANCE_MELEE_SLEDGEHAMMER 12.5
#define ITEM_ENCUMBRANCE_MELEE_SPEAR 7.5 * 1.75
#define ITEM_ENCUMBRANCE_MELEE_SLEDGEHAMMER 12.5 * 1.75

#define ITEM_ENCUMBRANCE_SHIELD_TOWER 12.5
#define ITEM_ENCUMBRANCE_SHIELD_TOWER 12.5 * 1.75

//? Item Flat Encumbrance defines

Expand Down
6 changes: 0 additions & 6 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1006,10 +1006,6 @@
/proc/is_sharp(obj/O as obj)
if(!O)
return FALSE
if(O.sharp)
return TRUE
if(O.edge)
return TRUE
if(isitem(O))
var/obj/item/I = O
if(I.damage_mode & DAMAGE_MODE_SHARP)
Expand All @@ -1020,8 +1016,6 @@
/proc/has_edge(obj/O as obj)
if(!O)
return FALSE
if(O.edge)
return TRUE
if(isitem(O))
var/obj/item/I = O
if(I.damage_mode & DAMAGE_MODE_EDGE)
Expand Down
11 changes: 11 additions & 0 deletions code/controllers/subsystem/throwing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,17 @@ SUBSYSTEM_DEF(throwing)
/datum/thrownthing/proc/is_pacifistic()
return throw_flags & THROW_AT_IS_GENTLE

/**
* get damage for a target
*/
/datum/thrownthing/proc/get_damage_force(atom/target)
. = thrownthing.throw_force
if(isitem(thrownthing))
var/obj/item/I = thrownthing
if(isnull(.))
. = I.damage_force
return . * get_damage_multiplier(target)

/**
* get damage scaling - default handling
*
Expand Down
Loading
Loading