Skip to content

Commit

Permalink
conflict merges where kinda a bitch
Browse files Browse the repository at this point in the history
  • Loading branch information
FalloutFalcon committed Jun 7, 2024
1 parent 992549e commit 0d24ffd
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 88 deletions.
19 changes: 15 additions & 4 deletions code/__DEFINES/guns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#define WEAPON_MEDIUM 2
/// You must wield the gun to fire this gun
#define WEAPON_HEAVY 3
/// You must FULLY wield (wait the full wield delay) the gun to fire this gun
#define WEAPON_VERY_HEAVY 4
//Gun trigger guards
#define TRIGGER_GUARD_ALLOW_ALL -1
#define TRIGGER_GUARD_NONE 0
Expand All @@ -28,6 +30,13 @@
///added recoil of sawn off guns
#define SAWN_OFF_RECOIL 1

//ammo box sprite defines
///ammo box will always use provided icon state
#define AMMO_BOX_ONE_SPRITE 0
///ammo box will have a different state for each bullet; <icon_state>-<bullets left>
#define AMMO_BOX_PER_BULLET 1
///ammo box will have a different state for full and empty; <icon_state>-max_ammo and <icon_state>-0
#define AMMO_BOX_FULL_EMPTY 2
/* Stolen from tgmc.. Will use soon
//Gun defines for gun related thing. More in the projectile folder.
//gun_features_flags
Expand All @@ -49,10 +58,6 @@
#define GUN_SHOWS_LOADED (1<<15) //Whether the mob sprite as loaded or unloaded, a binary version of the above
#define GUN_SMOKE_PARTICLES (1<<16) //Whether the gun has smoke particles
#define GUN_FIREMODE_SEMIAUTO "semi-auto fire mode"
#define GUN_FIREMODE_BURSTFIRE "burst-fire mode"
#define GUN_FIREMODE_AUTOMATIC "automatic fire mode"
#define GUN_FIREMODE_AUTOBURST "auto-burst-fire mode"
*/

//Autofire component
Expand Down Expand Up @@ -214,3 +219,9 @@ DEFINE_BITFIELD(attach_slots, list(

#define MOVES_HITSCAN -1 //Not actually hitscan but close as we get without actual hitscan.
#define MUZZLE_EFFECT_PIXEL_INCREMENT 17 //How many pixels to move the muzzle flash up so your character doesn't look like they're shitting out lasers.

#define FIREMODE_SEMIAUTO "single"
#define FIREMODE_BURST "burst"
#define FIREMODE_FULLAUTO "auto"
#define FIREMODE_OTHER "other"
#define FIREMODE_OTHER_TWO "other2"
2 changes: 1 addition & 1 deletion code/modules/cargo/blackmarket/blackmarket_items/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
/datum/blackmarket_item/tool/suppressor
name = "Suppressor"
desc = "A suppressor, for when you to keep your murder on the down low."
item = /obj/item/suppressor
item = /obj/item/attachment/silencer

price_min = 100
price_max = 700
Expand Down
114 changes: 33 additions & 81 deletions code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -186,83 +186,6 @@
//Alters projectile damage multiplicatively based on this value. Use it for "better" or "worse" weapons that use the same ammo.
var/projectile_damage_multiplier = 1
//Speed someone can be flung if its point blank
///Text showed when attempting to fire with no round or empty round.
var/dry_fire_text = "click"
///whether or not a message is displayed when fired
var/suppressed = null
var/can_suppress = FALSE
var/suppressed_sound = 'sound/weapons/gun/general/heavy_shot_suppressed.ogg'
var/suppressed_volume = 60
var/can_unsuppress = TRUE
var/obj/item/ammo_casing/chambered = null
///trigger guard on the weapon. Used for hulk mutations and ashies. I honestly dont know how usefult his is, id avoid touching it
trigger_guard = TRIGGER_GUARD_NORMAL
///Set the description of the gun to this when sawed off
var/sawn_desc = null
///This triggers some sprite behavior in shotguns and prevents further sawoff, note that can_be_sawn_off is on gun/ballistic and not here, wtf.
var/sawn_off = FALSE

/// how many shots per burst, Ex: most machine pistols, M90, some ARs are 3rnd burst, while others like the GAR and laser minigun are 2 round burst.
var/burst_size = 3
///The rate of fire when firing in a burst. Not the delay between bursts
var/burst_delay = 0.15 SECONDS
///The rate of fire when firing full auto and semi auto, and between bursts; for bursts its fire delay + burst_delay after every burst
var/fire_delay = 0.2 SECONDS

/// after initializing, we set the firemode to this
var/default_firemode = FIREMODE_SEMIAUTO
///Firemode index, due to code shit this is the currently selected firemode
var/firemode_index
/// Our firemodes, subtract and add to this list as needed. NOTE that the autofire component is given on init when FIREMODE_FULLAUTO is here.
var/list/gun_firemodes = list(FIREMODE_SEMIAUTO, FIREMODE_BURST, FIREMODE_FULLAUTO, FIREMODE_OTHER, FIREMODE_OTHER_TWO)
/// A acoc list that determines the names of firemodes. Use if you wanna be weird and set the name of say, FIREMODE_OTHER to "Underbarrel grenade launcher" for example.
var/list/gun_firenames = list(FIREMODE_SEMIAUTO = "single", FIREMODE_BURST = "burst fire", FIREMODE_FULLAUTO = "full auto", FIREMODE_OTHER = "misc. fire", FIREMODE_OTHER_TWO = "very misc. fire")
///BASICALLY: the little button you select firing modes from? this is jsut the prefix of the icon state of that. For example, if we set it as "laser", the fire select will use "laser_single" and so on.
var/fire_select_icon_state_prefix = ""
///If true, we put "safety_" before fire_select_icon_state_prefix's prefix. ex. "safety_laser_single"
var/adjust_fire_select_icon_state_on_safety = FALSE

///Are we firing a burst? If so, dont fire again until burst is done
var/currently_firing_burst = FALSE
///This prevents gun from firing until the coodown is done, affected by lag
var/current_cooldown = 0
///affects if you can fire it unwielded or even dual wield it. LIGHT means dual wield allowed, HEAVY and higher means you have to wield to fire
var/weapon_weight = WEAPON_LIGHT
///If dual wielding, add this to the spread
var/dual_wield_spread = 24
/// ???, no clue what this is. Original desc: //Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once.
var/randomspread = 1

///Alters projectile damage multiplicatively based on this value. Use it for "better" or "worse" weapons that use the same ammo.
var/projectile_damage_multiplier = 1

lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi'

var/list/attachment_options = list() //This.. works for now.. gun refactor soon

var/can_flashlight = FALSE //if a flashlight can be added or removed if it already has one.
var/obj/item/flashlight/seclite/gun_light
var/datum/action/item_action/toggle_gunlight/alight
var/gunlight_state = "flight"

var/can_bayonet = FALSE //if a bayonet can be added or removed if it already has one.
var/obj/item/kitchen/knife/bayonet
var/knife_x_offset = 0
var/knife_y_offset = 0

var/ammo_x_offset = 0 //used for positioning ammo count overlay on sprite
var/ammo_y_offset = 0
var/flight_x_offset = 0
var/flight_y_offset = 0

//Zooming
var/zoomable = FALSE //whether the gun generates a Zoom action on creation
var/zoomed = FALSE //Zoom toggle
var/zoom_amt = 3 //Distance in TURFs to move the user's screen forward (the "zoom" effect)
var/zoom_out_amt = 0
var/datum/action/toggle_scope_zoom/azoom

var/pb_knockback = 0

//Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once.
Expand All @@ -284,10 +207,12 @@
///this is how much deviation the gun recoil can have, recoil pushes the screen towards the reverse angle you shot + some deviation which this is the max.
var/recoil_deviation = 22.5

//how large a burst is
var/burst_size = 1
//rate of fire for burst firing and semi auto
var/fire_delay = 0
/// how many shots per burst, Ex: most machine pistols, M90, some ARs are 3rnd burst, while others like the GAR and laser minigun are 2 round burst.
var/burst_size = 3
///The rate of fire when firing in a burst. Not the delay between bursts
var/burst_delay = 0.15 SECONDS
///The rate of fire when firing full auto and semi auto, and between bursts; for bursts its fire delay + burst_delay after every burst
var/fire_delay = 0.2 SECONDS
//Prevent the weapon from firing again while already firing
var/firing_burst = 0
//cooldown handler
Expand All @@ -307,6 +232,12 @@
var/mag_display_ammo = FALSE
///Whether the sprite has a visible indicator for being empty or not.
var/empty_indicator = FALSE
///Whether the sprite has a visible magazine or not
var/show_magazine_on_sprite = FALSE
///Whether the sprite has a visible ammo display or not
var/show_magazine_on_sprite_ammo = FALSE
///Whether the gun supports multiple special mag types
var/unique_mag_sprites_for_variants = FALSE

//ENERGY
//Do we handle overlays with base update_appearance()?
Expand Down Expand Up @@ -365,6 +296,27 @@
//set to true so the gun is given an empty cell
var/dead_cell = FALSE

///trigger guard on the weapon. Used for hulk mutations and ashies. I honestly dont know how usefult his is, id avoid touching it
trigger_guard = TRIGGER_GUARD_NORMAL

/// after initializing, we set the firemode to this
var/default_firemode = FIREMODE_SEMIAUTO
///Firemode index, due to code shit this is the currently selected firemode
var/firemode_index
/// Our firemodes, subtract and add to this list as needed. NOTE that the autofire component is given on init when FIREMODE_FULLAUTO is here.
var/list/gun_firemodes = list(FIREMODE_SEMIAUTO, FIREMODE_BURST, FIREMODE_FULLAUTO, FIREMODE_OTHER, FIREMODE_OTHER_TWO)
/// A acoc list that determines the names of firemodes. Use if you wanna be weird and set the name of say, FIREMODE_OTHER to "Underbarrel grenade launcher" for example.
var/list/gun_firenames = list(FIREMODE_SEMIAUTO = "single", FIREMODE_BURST = "burst fire", FIREMODE_FULLAUTO = "full auto", FIREMODE_OTHER = "misc. fire", FIREMODE_OTHER_TWO = "very misc. fire")
///BASICALLY: the little button you select firing modes from? this is jsut the prefix of the icon state of that. For example, if we set it as "laser", the fire select will use "laser_single" and so on.
var/fire_select_icon_state_prefix = ""
///If true, we put "safety_" before fire_select_icon_state_prefix's prefix. ex. "safety_laser_single"
var/adjust_fire_select_icon_state_on_safety = FALSE

///Are we firing a burst? If so, dont fire again until burst is done
var/currently_firing_burst = FALSE
///This prevents gun from firing until the coodown is done, affected by lag
var/current_cooldown = 0

/obj/item/gun/Initialize()
. = ..()
RegisterSignal(src, COMSIG_TWOHANDED_WIELD, PROC_REF(on_wield))
Expand Down
1 change: 0 additions & 1 deletion code/modules/projectiles/guns/ballistic/automatic.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

/obj/item/gun/ballistic/automatic
w_class = WEIGHT_CLASS_NORMAL
can_suppress = TRUE

gun_firemodes = list(FIREMODE_SEMIAUTO)
default_firemode = FIREMODE_SEMIAUTO
Expand Down
1 change: 0 additions & 1 deletion code/modules/projectiles/guns/ballistic/pistol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
icon_state = "pistol"
w_class = WEIGHT_CLASS_SMALL
mag_type = /obj/item/ammo_box/magazine/m10mm
can_suppress = TRUE
actions_types = list()
bolt_type = BOLT_TYPE_LOCKING
fire_sound = 'sound/weapons/gun/pistol/shot.ogg'
Expand Down

0 comments on commit 0d24ffd

Please sign in to comment.