Skip to content

Commit

Permalink
Fort and prudence buff; Gun overhaul
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitsunemitsu committed Dec 5, 2024
1 parent 8cc7d9a commit ae9e8a9
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 18 deletions.
7 changes: 5 additions & 2 deletions ModularTegustation/ego_weapons/_ego_weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@
user.changeNext_move(CLICK_CD_MELEE * attack_speed)
return TRUE

/obj/item/ego_weapon/attack(mob/living/M, mob/living/user)
/obj/item/ego_weapon/attack(mob/living/M, mob/living/carbon/human/user)
. = ..()
if(stuntime)
user.Immobilize(stuntime)
//You can remove a small amount of stuntime, about 30%, based off your fortitude
var/usedstun = stuntime*0.7 + min(get_attribute_level(user, FORTITUDE_ATTRIBUTE)/130, 1)*0.3 //This should help people hate spears and big weapons less.

user.Immobilize(usedstun)
//Visual stuff to give you better feedback
new /obj/effect/temp_visual/weapon_stun(get_turf(user))
new /obj/effect/temp_visual/dir_setting/bloodsplatter(get_turf(M), pick(GLOB.alldirs))
Expand Down
36 changes: 33 additions & 3 deletions ModularTegustation/ego_weapons/ranged/_ranged.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@
var/fire_delay = 0 //rate of fire for burst firing and semi auto
var/firing_burst = 0 //Prevent the weapon from firing again while already firing
var/semicd = 0 //cooldown handler
var/dual_wield_spread = 24 //additional spread when dual wielding
var/dual_wield_spread = 10 //additional spread when dual wielding
var/forced_melee = FALSE //forced to melee attack. Currently only used for the ego_gun subtype

var/spread = 0 //Spread induced by the gun itself.
var/spread = 32 //Spread induced by the gun itself.
var/randomspread = 1 //Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once.

var/ammo_x_offset = 0 //used for positioning ammo count overlay on sprite
Expand All @@ -94,6 +94,8 @@

/obj/item/ego_weapon/ranged/Initialize()
. = ..()
if(pellets!=1)
randomspread = 0
if(pin)
pin = new pin(src)
build_zooming()
Expand Down Expand Up @@ -135,6 +137,19 @@
if(2.51 to INFINITY)
. += span_notice("This weapon has an extremely slow reload.")

switch(spread && pellets == 1)
if(0 to 20)
. += span_notice("This weapon is extremely accurate.") //Generally marksman rifles.
if(21 to 30)
. += span_notice("This weapon is accurate.") //Autorifles, Pistols.
if(31 to 35)
. += span_notice("This weapon is somewhat inaccurate.") //SMGs
else
. += span_notice("This weapon is inaccurate.") //Usually for special cases

if(pellets!=1)
. += span_notice("This weapon fires [pellets] pellets.")

switch(weapon_weight)
if(WEAPON_HEAVY)
. += span_notice("This weapon requires both hands to fire.")
Expand Down Expand Up @@ -191,7 +206,12 @@
is_reloading = TRUE
to_chat(user,span_notice("You start loading a new magazine."))
playsound(src, 'sound/weapons/gun/general/slide_lock_1.ogg', 50, TRUE)
if(do_after(user, reloadtime, src)) //gotta reload

//Get a bonus of up to 40% reload speed to fortitude
var/passreload = min((get_attribute_level(user, FORTITUDE_ATTRIBUTE)-20)/110, 1)
passreload = reloadtime - reloadtime/passreload*0.3

if(do_after(user, passreload, src)) //gotta reload
playsound(src, 'sound/weapons/gun/general/bolt_rack.ogg', 50, TRUE)
shotsleft = initial(shotsleft)
forced_melee = FALSE //no longer forced to resort to melee
Expand Down Expand Up @@ -311,6 +331,8 @@
if(weapon_weight == WEAPON_HEAVY && (user.get_inactive_held_item() || !other_hand))
to_chat(user, span_warning("You need two hands to fire [src]!"))
return


//DUAL (or more!) WIELDING
var/bonus_spread = 0
var/loop_counter = 0
Expand All @@ -324,6 +346,14 @@
loop_counter++
addtimer(CALLBACK(G, TYPE_PROC_REF(/obj/item/ego_weapon/ranged, process_fire), target, user, TRUE, params, null, bonus_spread), loop_counter)

//Get a small scatter increase for doubling with melee and gun. I am directly nerfing MY playstyle here.
if(user.get_inactive_held_item())
bonus_spread += spread*0.2

//And get a bonus to scatter up to about 40% less when you're at maximum prudence. Clerks get a scatter increase
var/scatter_reduction = min((get_attribute_level(user, PRUDENCE_ATTRIBUTE)-20)/110, 1)
bonus_spread -= scatter_reduction*0.4

return process_fire(target, user, TRUE, params, null, bonus_spread)

/obj/item/ego_weapon/ranged/can_trigger_gun(mob/living/user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
projectile.def_zone = user.zone_selected
projectile.suppressed = quiet

projectile.damage += projectile.damage*get_attribute_level(user, JUSTICE_ATTRIBUTE)/130*0.20 //Guns get a 20% bonus from justice
projectile.damage *= projectile_damage_multiplier
if(temporary_damage_multiplier)
projectile.damage *= temporary_damage_multiplier
Expand Down
7 changes: 4 additions & 3 deletions ModularTegustation/ego_weapons/ranged/aleph.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

projectile_path = /obj/projectile/ego_bullet/star
weapon_weight = WEAPON_HEAVY
spread = 5

autofire = 0.25 SECONDS
shotsleft = 333
Expand Down Expand Up @@ -58,6 +57,7 @@

force = 56
damtype = BLACK_DAMAGE
spread = 30

projectile_path = /obj/projectile/ego_bullet/adoration
weapon_weight = WEAPON_HEAVY
Expand Down Expand Up @@ -189,6 +189,7 @@
weapon_weight = WEAPON_HEAVY
fire_sound = 'sound/abnormalities/armyinblack/pink.ogg'
fire_delay = 9
spread = 5 //small amount
zoomable = TRUE
zoom_amt = 10
zoom_out_amt = 13
Expand Down Expand Up @@ -264,7 +265,7 @@
force = 56
projectile_path = /obj/projectile/ego_bullet/arcadia
weapon_weight = WEAPON_HEAVY
spread = 5
spread = 18
recoil = 1.5
fire_sound = 'sound/weapons/gun/rifle/shot_atelier.ogg'
vary_fire_sound = TRUE
Expand Down Expand Up @@ -303,6 +304,7 @@
recoil = 2
fire_sound_volume = 30
fire_delay = 12
spread = 32


shotsleft = 6 //Based off a colt Single Action Navy
Expand All @@ -318,7 +320,6 @@
damtype = PALE_DAMAGE
projectile_path = /obj/projectile/ego_bullet/ego_hookah
weapon_weight = WEAPON_HEAVY
spread = 20
fire_sound = 'sound/effects/smoke.ogg'
autofire = 0.04 SECONDS
fire_sound_volume = 5
Expand Down
12 changes: 11 additions & 1 deletion ModularTegustation/ego_weapons/ranged/he.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
weapon_weight = WEAPON_HEAVY
fire_delay = 5
shotsleft = 10
spread = 18
reloadtime = 1.4 SECONDS
fire_sound = 'sound/weapons/gun/rifle/shot_alt.ogg'
attribute_requirements = list(
Expand All @@ -30,6 +31,7 @@
vary_fire_sound = FALSE
weapon_weight = WEAPON_HEAVY
fire_sound_volume = 70
spread = 32 //It's really heavy
attribute_requirements = list(
FORTITUDE_ATTRIBUTE = 40
)
Expand All @@ -48,6 +50,7 @@
fire_sound = 'sound/magic/wand_teleport.ogg'
weapon_weight = WEAPON_MEDIUM
fire_sound_volume = 70
spread = 22
attribute_requirements = list(
TEMPERANCE_ATTRIBUTE = 40
)
Expand Down Expand Up @@ -85,6 +88,7 @@
vary_fire_sound = FALSE
weapon_weight = WEAPON_HEAVY
fire_sound_volume = 70
spread = 27
attribute_requirements = list(
TEMPERANCE_ATTRIBUTE = 40
)
Expand Down Expand Up @@ -159,6 +163,7 @@
fire_sound_volume = 70
shotsleft = 18
reloadtime = 1.6 SECONDS
spread = 18 //I'm not evil.

autofire = 0.35 SECONDS
attribute_requirements = list(
Expand All @@ -175,6 +180,7 @@
weapon_weight = WEAPON_HEAVY
fire_delay = 5
shotsleft = 10
spread = 18
reloadtime = 1.4 SECONDS
fire_sound = 'sound/weapons/gun/rifle/shot_alt.ogg'
attribute_requirements = list(
Expand All @@ -193,7 +199,7 @@
weapon_weight = WEAPON_MEDIUM
shotsleft = 32
reloadtime = 1.6 SECONDS
spread = 8
spread = 32
autofire = 0.15 SECONDS
attribute_requirements = list(
PRUDENCE_ATTRIBUTE = 40
Expand Down Expand Up @@ -225,6 +231,7 @@
icon_state = "screamingwedge"
inhand_icon_state = "screamingwedge"
force = 20
spread = 15
damtype = WHITE_DAMAGE
projectile_path = /obj/projectile/ego_bullet/ego_wedge
weapon_weight = WEAPON_HEAVY
Expand All @@ -249,6 +256,7 @@
weapon_weight = WEAPON_HEAVY
fire_delay = 5
shotsleft = 12
spread = 32
reloadtime = 1.5 SECONDS
fire_sound = 'sound/weapons/gun/pistol/shot.ogg'
attribute_requirements = list(
Expand Down Expand Up @@ -327,6 +335,7 @@
fire_delay = 10
shotsleft = 4
reloadtime = 2.1 SECONDS
spread = 18
attribute_requirements = list(
FORTITUDE_ATTRIBUTE = 40
)
Expand All @@ -342,6 +351,7 @@
fire_delay = 8
shotsleft = 6
reloadtime = 1.3 SECONDS
spread = 24
fire_sound = 'sound/weapons/gun/revolver/shot_alt.ogg'
vary_fire_sound = FALSE
var/list/ammotypes = list(
Expand Down
2 changes: 2 additions & 0 deletions ModularTegustation/ego_weapons/ranged/special.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
projectile_path = /obj/projectile/ego_bullet/ego_soda/rifle
weapon_weight = WEAPON_HEAVY
fire_delay = 3
spread = 18
fire_sound = 'sound/weapons/gun/rifle/shot.ogg'

/obj/item/ego_weapon/ranged/sodashotty
Expand All @@ -33,6 +34,7 @@
projectile_path = /obj/projectile/ego_bullet/ego_soda
weapon_weight = WEAPON_HEAVY
spread = 8
spread = 32
fire_sound = 'sound/weapons/gun/smg/shot.ogg'
autofire = 0.15 SECONDS

Expand Down
14 changes: 12 additions & 2 deletions ModularTegustation/ego_weapons/ranged/teth.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
weapon_weight = WEAPON_HEAVY
fire_delay = 15
shotsleft = 8
spread = 18 //It's a rocket launcher so it should be accurate
reloadtime = 2.2 SECONDS
fire_sound = 'sound/weapons/ego/cannon.ogg'

Expand All @@ -27,7 +28,7 @@
force = 14
projectile_path = /obj/projectile/ego_bullet/ego_beak
weapon_weight = WEAPON_MEDIUM
spread = 10
spread = 32
shotsleft = 30
reloadtime = 1.3 SECONDS
fire_sound = 'sound/weapons/gun/smg/mp7.ogg'
Expand All @@ -47,7 +48,8 @@
fire_sound = 'sound/weapons/gun/revolver/shot_alt.ogg'
vary_fire_sound = FALSE
fire_sound_volume = 70
dual_wield_spread = 0
dual_wield_spread = -20
spread = 18

/obj/item/ego_weapon/ranged/noise
name = "noise"
Expand Down Expand Up @@ -80,6 +82,7 @@
fire_sound = 'sound/weapons/gun/revolver/shot_light.ogg'
vary_fire_sound = FALSE
fire_sound_volume = 70
spread = 18

/obj/item/ego_weapon/ranged/pistol/shy
name = "todays expression"
Expand All @@ -95,6 +98,7 @@
shotsleft = 20
reloadtime = 1.2 SECONDS
autofire = 0.2 SECONDS
spread = 27 //little bit of a break

/obj/item/ego_weapon/ranged/dream
name = "engulfing dream"
Expand All @@ -107,6 +111,7 @@
weapon_weight = WEAPON_HEAVY
fire_sound = "dreamy_gun"
autofire = 0.25 SECONDS
spread = 32

/obj/item/ego_weapon/ranged/page
name = "page"
Expand All @@ -119,6 +124,7 @@
weapon_weight = WEAPON_HEAVY
fire_delay = 5
shotsleft = 10
spread = 18
reloadtime = 1.4 SECONDS
fire_sound = 'sound/weapons/gun/rifle/shot_alt.ogg'

Expand All @@ -133,6 +139,7 @@
projectile_path = /obj/projectile/beam/snapshot
weapon_weight = WEAPON_HEAVY
fire_delay = 10
spread = 18
fire_sound = 'sound/weapons/sonic_jackhammer.ogg'

/obj/item/ego_weapon/ranged/wishing_cairn
Expand All @@ -148,6 +155,7 @@
fire_delay = 3
burst_size = 2
fire_sound = 'sound/abnormalities/pagoda/throw.ogg'
spread = 26 //I guess throwing is inaccurate?
var/ammo2 = /obj/projectile/ego_bullet/ego_wishing2

/obj/item/ego_weapon/ranged/wishing_cairn/proc/Ammo_Change()
Expand All @@ -169,6 +177,7 @@
projectile_path = /obj/projectile/ego_bullet/ego_aspiration
weapon_weight = WEAPON_HEAVY
autofire = 0.5 SECONDS
spread = 18
fire_sound = 'sound/abnormalities/fragment/attack.ogg'

/obj/item/ego_weapon/ranged/aspiration/before_firing(atom/target,mob/user)
Expand Down Expand Up @@ -209,4 +218,5 @@
projectile_path = /obj/projectile/ego_bullet/ego_luckdraw
weapon_weight = WEAPON_HEAVY
autofire = 0.6 SECONDS
spread = 32
fire_sound = 'sound/items/handling/paper_pickup.ogg' //Mostly just using this for a lack of a better "card-flicking" noise
Loading

0 comments on commit ae9e8a9

Please sign in to comment.