Skip to content

Commit 4137b01

Browse files
authored
guncode update (and misc refactors) (#6740)
1 parent 48a9cc2 commit 4137b01

File tree

451 files changed

+8766
-6259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

451 files changed

+8766
-6259
lines changed

citadel.dme

Lines changed: 131 additions & 82 deletions
Large diffs are not rendered by default.

code/__DEFINES/_flags/atom_flags.dm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,15 @@ DEFINE_BITFIELD(movable_flags, list(
8686
/// let buckled mobs pass always
8787
#define ATOM_PASS_BUCKLED (1<<8)
8888
/// "please don't interact with us"
89+
/// todo: is this the same as PHASING movement?
8990
#define ATOM_PASS_INCORPOREAL (1<<9)
9091

9192
/// all actual pass flags / maximum pass
92-
#define ATOM_PASS_ALL (ATOM_PASS_TABLE | ATOM_PASS_GLASS | ATOM_PASS_GRILLE | \
93+
#define ATOM_PASS_FLAGS_ALL (ATOM_PASS_TABLE | ATOM_PASS_GLASS | ATOM_PASS_GRILLE | \
9394
ATOM_PASS_BLOB | ATOM_PASS_MOB | ATOM_PASS_THROWN | ATOM_PASS_CLICK | \
9495
ATOM_PASS_OVERHEAD_THROW | ATOM_PASS_BUCKLED | ATOM_PASS_INCORPOREAL)
96+
/// used for beams
97+
#define ATOM_PASS_FLAGS_BEAM (ATOM_PASS_TABLE | ATOM_PASS_GLASS)
9598

9699
DEFINE_BITFIELD(pass_flags, list(
97100
BITFIELD(ATOM_PASS_TABLE),

code/__DEFINES/_flags/item_flags.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#define ITEM_THROW_UNCATCHABLE (1<<5)
1515
/// we cannot be used a tool on click, no matter what
1616
#define ITEM_NO_TOOL_ATTACK (1<<6)
17-
/// we're dual wielded - multi-wielding coming later tm
17+
/// we're wielded, usually via /datum/component/wielding
1818
#define ITEM_MULTIHAND_WIELDED (1<<7)
1919
/// don't allow help intent attacking
2020
#define ITEM_CAREFUL_BLUDGEON (1<<8)

code/__DEFINES/_tick.dm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
/// Percentage of tick to leave for master controller to run
22
#define MAPTICK_MC_MIN_RESERVE 70
33

4-
/// ~~internal_tick_usage is updated every tick by extools~~
5-
/// sike we use byond now
6-
#if DM_VERSION > 513
74
#define MAPTICK_LAST_INTERNAL_TICK_USAGE world.map_cpu
8-
#else
9-
#define MAPTICK_LAST_INTERNAL_TICK_USAGE 20
10-
#endif
115

126
/// Tick limit while running normally
137
#define TICK_BYOND_RESERVE 2

code/__DEFINES/combat/armor.dm

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//* This file is explicitly licensed under the MIT license. *//
2-
//* Copyright (c) 2023 Citadel Station developers. *//
2+
//* Copyright (c) 2024 Citadel Station Developers *//
33

44
//? --- armor defines ---
55
//* Want to add more?
@@ -38,6 +38,9 @@
3838
#define ARMOR_FIRE "fire"
3939
#define ARMOR_ACID "acid"
4040

41+
/**
42+
* All armor enums that can be stored in an armor datum
43+
*/
4144
GLOBAL_REAL_LIST(armor_enums) = list(
4245
ARMOR_MELEE,
4346
ARMOR_MELEE_TIER,
@@ -59,6 +62,9 @@ GLOBAL_REAL_LIST(armor_enums) = list(
5962
ARMOR_ACID,
6063
)
6164

65+
/**
66+
* Actual armor types that can be checked for with `damage_flag`
67+
*/
6268
GLOBAL_REAL_LIST(armor_types) = list(
6369
ARMOR_MELEE,
6470
ARMOR_BULLET,
@@ -110,7 +116,7 @@ GLOBAL_REAL_LIST(armor_types) = list(
110116
#define BULLET_TIER_MEDIUM ARMOR_TIER_ABOVE
111117
/// rifles
112118
#define BULLET_TIER_HIGH ARMOR_TIER_HIGH
113-
/// lmgs, light mech weapons
119+
/// hmgs, light mech weapons
114120
#define BULLET_TIER_EXTREME ARMOR_TIER_OVERWHELMING
115121
/// heavy mech weapons
116122
#define BULLET_TIER_RIDICULOUS ARMOR_TIER_RIDICULOUS

code/__DEFINES/combat/atom_damage.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//* This file is explicitly licensed under the MIT license. *//
2-
//* Copyright (c) 2023 Citadel Station developers. *//
2+
//* Copyright (c) 2023 Citadel Station Developers *//
33

44
//* Atom destruction types, used in /deconstruct() and its derived/child/called functions.
55

code/__DEFINES/combat/damage.dm

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323

2424
//* special hybrid types; processed specially depending on type *//
2525

26-
/// passed to electrocute_act()
27-
/// todo: remove
28-
#define DAMAGE_TYPE_ELECTROCUTE "electrocute"
2926
/// bioacid ; toxins for organics, acid for synthetics
3027
/// todo: better hybrid type handling
3128
#define DAMAGE_TYPE_BIOACID "bioacid"

code/__DEFINES/combat/fx.dm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//* This file is explicitly licensed under the MIT license. *//
2+
//* Copyright (c) 2025 Citadel Station Developers *//
3+
4+
//* Combat Impact FX Classifiers *//
5+
//* These are returned from an atom on query so the attacker knows what sound / visual to play. *//
6+
7+
#define COMBAT_IMPACT_FX_GENERIC "generic"
8+
#define COMBAT_IMPACT_FX_FLESH "flesh"
9+
#define COMBAT_IMPACT_FX_WOOD "wood"
10+
#define COMBAT_IMPACT_FX_METAL "metal"

code/__DEFINES/datums/design.dm

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
//? lathe_type bitfield
2-
3-
#define LATHE_TYPE_AUTOLATHE (1<<0)
4-
#define LATHE_TYPE_PROTOLATHE (1<<1)
5-
#define LATHE_TYPE_CIRCUIT (1<<2)
6-
#define LATHE_TYPE_PROSTHETICS (1<<3)
7-
#define LATHE_TYPE_MECHA (1<<4)
8-
#define LATHE_TYPE_BIOPRINTER (1<<5)
9-
10-
DEFINE_BITFIELD(lathe_type, list(
11-
BITFIELD(LATHE_TYPE_AUTOLATHE),
12-
BITFIELD(LATHE_TYPE_PROTOLATHE),
13-
BITFIELD(LATHE_TYPE_CIRCUIT),
14-
BITFIELD(LATHE_TYPE_PROSTHETICS),
15-
BITFIELD(LATHE_TYPE_MECHA),
16-
BITFIELD(LATHE_TYPE_BIOPRINTER),
17-
))
18-
191
//? design_unlock bitfield
202

213
/// any lathe that can print us should have us always
@@ -75,6 +57,7 @@ DEFINE_BITFIELD(design_flags, list(
7557

7658
//munition subcategories
7759
#define DESIGN_SUBCATEGORY_BALLISTIC "Ballistic"
60+
#define DESIGN_SUBCATEGORY_MAGNETIC "Magnetic"
7861
#define DESIGN_SUBCATEGORY_ENERGY "Energy"
7962
#define DESIGN_SUBCATEGORY_MELEE "Melee"
8063
#define DESIGN_SUBCATEGORY_AMMO "Ammo"
@@ -103,3 +86,56 @@ DEFINE_BITFIELD(design_flags, list(
10386
//science subcategories
10487
#define DESIGN_SUBCATEGORY_XENOBIOLOGY "Xenobiology"
10588
#define DESIGN_SUBCATEGORY_XENOARCHEOLOGY "Xenoarcheology"
89+
90+
//* Design Helpers - Generic *//
91+
92+
/**
93+
* Generate a design for an entity.
94+
*
95+
* * Design path is appended to `/datum/prototype/design/generated`.
96+
*/
97+
#define GENERATE_DESIGN(ENTITY_PATH, DESIGN_PATH, DESIGN_ID) \
98+
/datum/prototype/design/generated##DESIGN_PATH { \
99+
id = DESIGN_ID; \
100+
build_path = ENTITY_PATH; \
101+
}; \
102+
/datum/prototype/design/generated##DESIGN_PATH
103+
104+
//* Design Helpers - For a specific lathe *//
105+
106+
/**
107+
* Generates for all lathes.
108+
* * Implicitly allows protolathes to build it.
109+
*/
110+
#define GENERATE_DESIGN_FOR_AUTOLATHE(ENTITY_PATH, DESIGN_PATH, DESIGN_ID) \
111+
GENERATE_DESIGN(ENTITY_PATH, DESIGN_PATH, DESIGN_ID); \
112+
/datum/prototype/design/generated##DESIGN_PATH { \
113+
lathe_type = LATHE_TYPE_AUTOLATHE | LATHE_TYPE_PROTOLATHE; \
114+
}; \
115+
/datum/prototype/design/generated##DESIGN_PATH
116+
117+
/**
118+
* Generates for protolathes.
119+
*/
120+
#define GENERATE_DESIGN_FOR_PROTOLATHE(ENTITY_PATH, DESIGN_PATH, DESIGN_ID) \
121+
GENERATE_DESIGN(ENTITY_PATH, DESIGN_PATH, DESIGN_ID); \
122+
/datum/prototype/design/generated##DESIGN_PATH { \
123+
lathe_type = LATHE_TYPE_PROTOLATHE; \
124+
}; \
125+
/datum/prototype/design/generated##DESIGN_PATH
126+
127+
//* Design Helpers - For a specific lathe & faction *//
128+
129+
/**
130+
* Generates for Nanotrasen-standard autolathes. In the future, we might have flags
131+
* for what factions get it automatically.
132+
*/
133+
#define GENERATE_DESIGN_FOR_NT_AUTOLATHE(ENTITY_PATH, DESIGN_PATH, DESIGN_ID) \
134+
GENERATE_DESIGN_FOR_AUTOLATHE(ENTITY_PATH, DESIGN_PATH, DESIGN_ID)
135+
136+
/**
137+
* Generates for Nanotrasen-standard protolathes. In the future, we might have flags
138+
* for what factions get it automatically.
139+
*/
140+
#define GENERATE_DESIGN_FOR_NT_PROTOLATHE(ENTITY_PATH, DESIGN_PATH, DESIGN_ID) \
141+
GENERATE_DESIGN_FOR_PROTOLATHE(ENTITY_PATH, DESIGN_PATH, DESIGN_ID)
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//* This file is explicitly licensed under the MIT license. *//
2+
//* Copyright (c) 2024 Citadel Station Developers *//
3+
4+
//* Firing Cycles *//
5+
6+
/**
7+
* Called before initiation of a firing cycle, with (datum/gun_firing_cycle/cycle).
8+
*/
9+
#define COMSIG_GUN_FIRING_CYCLE_START "gun-firing-start"
10+
11+
/**
12+
* Called on end of a firing cycle, with (datum/gun_firing_cycle/cycle).
13+
*/
14+
#define COMSIG_GUN_FIRING_CYCLE_END "gun-firing-end"
15+
16+
//* Fire() Injections *//
17+
18+
/**
19+
* Signature: (datum/gun_firing_cycle/cycle)
20+
* * Raised before every fire() call.
21+
*/
22+
#define COMSIG_GUN_FIRING_PREFIRE "gun-firing-prefire"
23+
24+
/**
25+
* Signature: (datum/gun_firing_cycle/cycle, obj/projectile/proj)
26+
* * Raised before every fire() call, after consume_next_projectile().
27+
* * Only valid on /obj/item/gun/projectile
28+
* * This happens after the nominal PNR, so anything like energy drains and whatnot would have already
29+
* been done by now. Keep that in mind.
30+
*/
31+
#define COMSIG_GUN_FIRING_PROJECTILE_INJECTION "gun-firing-projectile"
32+
33+
/**
34+
* Signature: (datum/gun_firing_cycle/cycle, atom/movable/proj)
35+
* * Raised before every fire() call, after consume_next_throwable().
36+
* * Only valid on /obj/item/gun/launcher
37+
* * This happens after the nominal PNR, so anything like energy drains and whatnot would have already
38+
* been done by now. Keep that in mind.
39+
*/
40+
#define COMSIG_GUN_FIRING_THROWABLE_INJECTION "gun-firing-throwable"
41+
42+
/**
43+
* Signature: (datum/gun_firing_cycle/cycle)
44+
* * Raised after every fire() call, before post_fire().
45+
*/
46+
#define COMSIG_GUN_FIRING_POSTFIRE "gun-firing-postfire"

0 commit comments

Comments
 (0)