Skip to content

Commit 7cb0041

Browse files
Merge pull request #107 from MistakeNot4892/fork/pyrelight
[IDB IGNORE] [MDB IGNORE] Updating from Neb dev
2 parents 94cc278 + b645919 commit 7cb0041

File tree

551 files changed

+4749
-3358
lines changed

Some content is hidden

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

551 files changed

+4749
-3358
lines changed

code/__defines/hud.dm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#define UI_ICON_NUTRITION "icon_nutrition"
1212
#define UI_ICON_HYDRATION "icon_hydration"
1313
#define UI_ICON_FIRE_INTENT "icon_fire_intent"
14-
#define UI_ICON_INTENT "icon_intent"
1514
#define UI_ICON_UP_HINT "icon_uphint"
1615
#define UI_ICON_STATUS "icon_status"
1716
#define UI_ICON_STATUS_FIRE "icon_status_fire"

code/__defines/intent.dm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Intent bitflags for use in check_intent()
2+
#define I_FLAG_HELP BITFLAG(0)
3+
#define I_FLAG_DISARM BITFLAG(1)
4+
#define I_FLAG_GRAB BITFLAG(2)
5+
#define I_FLAG_HARM BITFLAG(3)
6+
#define I_FLAG_ALL (I_FLAG_HELP|I_FLAG_DISARM|I_FLAG_GRAB|I_FLAG_HARM)
7+
8+
//NOTE: INTENT_HOTKEY_* defines are not actual intents!
9+
//they are here to support hotkeys
10+
#define INTENT_HOTKEY_LEFT "left"
11+
#define INTENT_HOTKEY_RIGHT "right"

code/__defines/misc.dm

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,6 @@
270270
/// Returns the hex value of a number given a value assumed to be a base-ten value, padded to a supplied minimum length.
271271
#define num2hex_padded(num, len) num2text(num, len, 16)
272272

273-
//NOTE: INTENT_HOTKEY_* defines are not actual intents!
274-
//they are here to support hotkeys
275-
#define INTENT_HOTKEY_LEFT "left"
276-
#define INTENT_HOTKEY_RIGHT "right"
277-
278273
//Turf/area values for 'this space is outside' checks
279274
#define OUTSIDE_AREA null
280275
#define OUTSIDE_NO FALSE

code/__defines/mobs.dm

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@
3434
#define GETPULSE_TOOL 1 // More accurate. (med scanner, sleeper, etc.)
3535
#define PULSE_MAX_BPM 250 // Highest, readable BPM by machines and humans.
3636

37-
//intent flags
38-
#define I_HELP "help"
39-
#define I_DISARM "disarm"
40-
#define I_GRAB "grab"
41-
#define I_HURT "harm"
42-
4337
//These are used Bump() code for living mobs, in the mob_bump_flag, mob_swap_flags, and mob_push_flags vars to determine whom can bump/swap with whom.
4438
#define HUMAN 1
4539
#define MONKEY 2

code/_helpers/cmp.dm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@
137137
/proc/cmp_decl_uid_asc(decl/a, decl/b)
138138
return sorttext(b.uid, a.uid)
139139

140+
/proc/cmp_decl_sort_value_asc(decl/a, decl/b)
141+
return a.sort_order - b.sort_order
142+
140143
/proc/cmp_inventory_slot_desc(datum/inventory_slot/a, datum/inventory_slot/b)
141144
return b.quick_equip_priority - a.quick_equip_priority
142145

@@ -154,4 +157,7 @@
154157
if(a == prerequisite)
155158
return -1 // goes after
156159
return cmp_skill_asc(a, GET_DECL(b.prerequisites[1]))
157-
return cmp_name_or_type_asc(a, b)
160+
return cmp_name_or_type_asc(a, b)
161+
162+
/proc/cmp_priority_list(list/A, list/B)
163+
return A["priority"] - B["priority"]

code/_helpers/visual_filters.dm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
/atom/movable
66
var/list/filter_data // For handling persistent filters
77

8-
/proc/cmp_filter_data_priority(list/A, list/B)
9-
return A["priority"] - B["priority"]
10-
118
// Defining this for future proofing and ease of searching for erroneous usage.
129
/image/proc/add_filter(filter_name, priority, list/params)
1310
filters += filter(arglist(params))
@@ -35,7 +32,7 @@
3532

3633
/atom/movable/proc/update_filters()
3734
filters = null
38-
filter_data = sortTim(filter_data, /proc/cmp_filter_data_priority, TRUE)
35+
filter_data = sortTim(filter_data, /proc/cmp_priority_list, TRUE)
3936
for(var/f in filter_data)
4037
var/list/data = filter_data[f]
4138
var/list/arguments = data.Copy()

code/_onclick/MouseDrag.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
return
1616

1717
var/obj/item/gun/gun = get_active_held_item()
18-
if(a_intent == I_HURT && istype(over_object) && (isturf(over_object) || isturf(over_object.loc)) && !incapacitated() && istype(gun))
18+
if(check_intent(I_FLAG_HARM) && istype(over_object) && (isturf(over_object) || isturf(over_object.loc)) && !incapacitated() && istype(gun))
1919
gun.set_autofire(over_object, src)
2020

2121
/mob/proc/OnMouseDown(atom/object, location, control, params)
@@ -25,7 +25,7 @@
2525
return
2626

2727
var/obj/item/gun/gun = get_active_held_item()
28-
if(a_intent == I_HURT && istype(object) && (isturf(object) || isturf(object.loc)) && !incapacitated() && istype(gun))
28+
if(check_intent(I_FLAG_HARM) && istype(object) && (isturf(object) || isturf(object.loc)) && !incapacitated() && istype(gun))
2929
gun.set_autofire(object, src)
3030

3131
/mob/proc/OnMouseUp(atom/object, location, control, params)

code/_onclick/click.dm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
if(holding)
119119

120120
// AI driven mobs have a melee telegraph that needs to be handled here.
121-
if(a_intent == I_HURT && istype(A) && (!do_attack_windup_checking(A) || holding != get_active_held_item()))
121+
if(check_intent(I_FLAG_HARM) && istype(A) && (!do_attack_windup_checking(A) || holding != get_active_held_item()))
122122
return TRUE
123123

124124
var/resolved = holding.resolve_attackby(A, src, params)
@@ -144,7 +144,7 @@
144144
if(holding)
145145

146146
// AI driven mobs have a melee telegraph that needs to be handled here.
147-
if(a_intent == I_HURT && istype(A) && (!do_attack_windup_checking(A) || holding != get_active_held_item()))
147+
if(check_intent(I_FLAG_HARM) && istype(A) && (!do_attack_windup_checking(A) || holding != get_active_held_item()))
148148
return TRUE
149149

150150
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
@@ -225,7 +225,7 @@
225225
// corgis attacking a tree, for example, will do the windup animation despite
226226
// having no interaction or message shown at the end of it.
227227
// AI driven mobs have a melee telegraph that needs to be handled here.
228-
if(a_intent == I_HURT && istype(A) && !do_attack_windup_checking(A))
228+
if(check_intent(I_FLAG_HARM) && istype(A) && !do_attack_windup_checking(A))
229229
return TRUE
230230

231231
return FALSE

code/_onclick/cyborg.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
return
138138

139139
/obj/machinery/door/airlock/BorgAltClick() // Eletrifies doors. Forwards to AI code.
140-
if (usr.a_intent != I_HELP)
140+
if (!usr.check_intent(I_FLAG_HELP))
141141
AICtrlAltClick()
142142
else
143143
..()

code/_onclick/hud/animal.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
move_intent = new(null, mymob, ui_style, ui_color, ui_alpha, UI_ICON_MOVEMENT)
1212
move_intent.icon_state = mymob.move_intent.hud_icon_state
1313
adding += move_intent
14-
action_intent = new(null, mymob, ui_style, ui_color, ui_alpha, UI_ICON_INTENT)
14+
action_intent = new(null, mymob, ui_style, ui_color, ui_alpha)
1515
adding += action_intent
1616
..()

0 commit comments

Comments
 (0)