undefines our defines (#8506)

This commit is contained in:
Kashargul
2024-06-09 18:58:36 +02:00
committed by GitHub
parent 15863e00f8
commit 0ab421aabe
8 changed files with 49 additions and 23 deletions

View File

@@ -1,14 +1,3 @@
#define NO_AUTO_LOAD 0
#define OPEN_BOLT 1
#define CLOSED_BOLT 2
#define LOCK_OPEN_EMPTY 4
#define LOCK_MANUAL_LOCK 8
#define LOCK_SLAPPABLE 16
#define CHAMBER_ON_RELOAD 32
#define INTERNAL_MAG_SEPARATE 1
#define IS_PUMP_SHOTGUN 2
#define BOLT_NOEVENT 0
#define BOLT_CLOSED 1
#define BOLT_OPENED 2
@@ -114,7 +103,7 @@
playsound(src, sound_ejectchamber, 50, 0)
user.visible_message("<span class='notice'>[user] pulls back \the [bolt_name] and locks it in the open position[casing_chambered][other_ejected].</span>", \
"<span class='notice'>You pull back \the [bolt_name] and lock it in the open position[other_ejected][casing_chambered].</span>")
else
else
user.visible_message("<span class='notice'>[user] pulls back \the [bolt_name] before releasing it, causing it to lock in the open position[casing_chambered][other_ejected].</span>", \
"<span class='notice'>You pull back \the [bolt_name] before releasing it, causing it to lock in the open position[casing_chambered][other_ejected].</span>")
else
@@ -167,7 +156,7 @@
else
bolt_open = TRUE
var/ejected = process_chambered()
var/output = BOLT_OPENED
if(ejected) output |= BOLT_CASING_EJECTED
//if(chambering) output |= BOLT_CASING_CHAMBERED
@@ -300,7 +289,7 @@
chamber_bullet()
bolt_toggle()
playsound(src, 'sound/weapons/flipblade.ogg', 50, 1)
user.hud_used.update_ammo_hud(user, src)
user.hud_used.update_ammo_hud(user, src)
if(SPEEDLOADER)
if(only_open_load && !bolt_open)
to_chat(user, "<span_class='warning'>[src] must have its bolt open to be loaded!</span>")
@@ -320,7 +309,7 @@
if(count)
user.visible_message("[user] reloads [src].", "<span class='notice'>You load [count] round\s into [src].</span>")
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
user.hud_used.update_ammo_hud(user, src)
user.hud_used.update_ammo_hud(user, src)
AM.update_icon()
else if(istype(A, /obj/item/ammo_casing))
var/obj/item/ammo_casing/C = A
@@ -334,15 +323,15 @@
if(do_after(user,5))
user.visible_message("<span class='notice'>[user] slides \the [C] into the [src]'s chamber.</span>","<span class='notice'>You slide \the [C] into the [src]'s chamber.</span>")
chambered = C
user.hud_used.update_ammo_hud(user, src)
user.hud_used.update_ammo_hud(user, src)
else
return
else if(!(CHECK_BITFIELD(auto_loading_type,LOCK_OPEN_EMPTY) || (CHECK_BITFIELD(auto_loading_type,LOCK_MANUAL_LOCK))))
if(do_after(user,15))
user.visible_message("<span class='notice'>[user] holds open \the [src]'s [bolt_name] and slides [C] into the chamber before letting the bolt close again.</span>","<span class='notice'>You slide \the [C] into the [src]'s chamber.</span>")
chambered = C
user.hud_used.update_ammo_hud(user, src)
user.hud_used.update_ammo_hud(user, src)
else
return
else
@@ -372,7 +361,7 @@
loaded.Insert(1, C) //add to the head of the list
user.visible_message("[user] inserts \a [C] into [src].", "<span class='notice'>You insert \a [C] into [src].</span>")
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
user.hud_used.update_ammo_hud(user, src)
user.hud_used.update_ammo_hud(user, src)
else if(istype(A, /obj/item/weapon/storage))
var/obj/item/weapon/storage/storage = A
@@ -386,7 +375,7 @@
continue
load_ammo(ammo, user)
user.hud_used.update_ammo_hud(user, src)
user.hud_used.update_ammo_hud(user, src)
if(loaded.len >= max_shells)
to_chat(user, "<span class='warning'>[src] is full.</span>")
@@ -495,3 +484,11 @@
if(!istype(P))
return
P.sub_velocity(P.velocity - 35)
#undef BOLT_NOEVENT
#undef BOLT_CLOSED
#undef BOLT_OPENED
#undef BOLT_LOCKED
#undef BOLT_UNLOCKED
#undef BOLT_CASING_EJECTED
#undef BOLT_CASING_CHAMBERED

View File

@@ -31,6 +31,8 @@ only use the hollow_point and armor_penetration values.*/
energy = max(0,energy - amount)
velocity = sqrt(2*energy/(grains / GRAINS_PER_KG))
#undef GRAINS_PER_KG
//Pistol projectiles
/obj/item/projectile/bullet/pistol //9x19mm
fire_sound = 'sound/weapons/ballistics/a9mm.ogg'
@@ -568,4 +570,4 @@ only use the hollow_point and armor_penetration values.*/
/obj/item/projectile/bullet/pistol/medium/ap/suppressor/turbo // spicy boys
speed = 0.2 // this is 4x projectile speed
hud_state = "monkey"
hud_state = "monkey"