Skip to content

Commit

Permalink
TGS Test Merge (#7335)
Browse files Browse the repository at this point in the history
  • Loading branch information
cm13-github committed Nov 23, 2024
2 parents 15b5d68 + c4734da commit 35c2780
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 13 deletions.
5 changes: 5 additions & 0 deletions code/datums/ammo/ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@
/datum/ammo/New()
set_bullet_traits()

/datum/ammo/proc/setup_faction_clash_values()
accuracy = (accuracy - 85)/2
penetration = min(penetration, 30) //more ap overpenatrates anyway but makes next calculation cleaner
accurate_range = min(accurate_range, 10 - penetration/5) //this makes AP ammo better at clsoe range (and techinicly super far range when the hitchance gets bottom caped at 5% hitchance)

/datum/ammo/proc/on_bullet_generation(obj/projectile/generated_projectile, mob/bullet_generator) //NOT used on New(), applied to the projectiles.
return

Expand Down
6 changes: 6 additions & 0 deletions code/datums/ammo/bullet/pistol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
penetration= ARMOR_PENETRATION_TIER_2
shrapnel_chance = SHRAPNEL_CHANCE_TIER_2

/datum/ammo/bullet/pistol/setup_faction_clash_values()
. = ..()
accuracy += 20
accurate_range -= 2 //we want pistols to be more accurate but only at short range


/datum/ammo/bullet/pistol/tiny
name = "light pistol bullet"

Expand Down
8 changes: 8 additions & 0 deletions code/datums/ammo/bullet/rifle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,20 @@
damage = 55
penetration = ARMOR_PENETRATION_TIER_3

/datum/ammo/bullet/rifle/type71/setup_faction_clash_values()
if(istype(src,/datum/ammo/bullet/rifle/type71/ap)||istype(src,/datum/ammo/bullet/rifle/type71/heap))
penetration = ARMOR_PENETRATION_TIER_6
else
penetration = ARMOR_PENETRATION_TIER_1
. = ..()

/datum/ammo/bullet/rifle/type71/ap
name = "heavy armor-piercing rifle bullet"

damage = 40
penetration = ARMOR_PENETRATION_TIER_10


/datum/ammo/bullet/rifle/type71/heap
name = "heavy high-explosive armor-piercing rifle bullet"

Expand Down
5 changes: 5 additions & 0 deletions code/datums/ammo/bullet/shotgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
/datum/ammo/bullet/shotgun
headshot_state = HEADSHOT_OVERLAY_HEAVY

/datum/ammo/bullet/shotgun/setup_faction_clash_values()
. = ..()
accuracy = accuracy * 2 + 85 //we revert accuracy reduction that is applied on other bullets shotguns are accurate but already have short range only


/datum/ammo/bullet/shotgun/slug
name = "shotgun slug"
handful_state = "slug_shell"
Expand Down
14 changes: 14 additions & 0 deletions code/datums/ammo/bullet/special_ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
penetration = 0
effective_range_max = 5

/datum/ammo/bullet/smartgun/setup_faction_clash_values()
. = ..()
max_range = 17
accurate_range = 12
effective_range_max = 12

/datum/ammo/bullet/smartgun/armor_piercing
name = "armor-piercing smartgun bullet"
icon_state = "bullet"
Expand Down Expand Up @@ -110,6 +116,10 @@
penetration= ARMOR_PENETRATION_TIER_10 //Bumped the penetration to serve a different role from sentries, MGs are a bit more offensive
accuracy = HIT_ACCURACY_TIER_3

/datum/ammo/bullet/machinegun/setup_faction_clash_values()
. = ..()
accurate_range = 12 //we revert the reduction

/datum/ammo/bullet/machinegun/set_bullet_traits()
. = ..()
LAZYADD(traits_to_give, list(
Expand Down Expand Up @@ -180,3 +190,7 @@
damage = 35
penetration= ARMOR_PENETRATION_TIER_6
shrapnel_chance = SHRAPNEL_CHANCE_TIER_2

/datum/ammo/bullet/pkp/setup_faction_clash_values()
. = ..()
accurate_range = 14
14 changes: 3 additions & 11 deletions code/datums/ammo/bullet/tank.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,6 @@
penetration = ARMOR_PENETRATION_TIER_6
damage_armor_punch = 1

/datum/ammo/bullet/tank/minigun/New()
..()
if(SSticker.mode && MODE_HAS_FLAG(MODE_FACTION_CLASH))
damage = 15
else if(SSticker.current_state < GAME_STATE_PLAYING)
RegisterSignal(SSdcs, COMSIG_GLOB_MODE_PRESETUP, PROC_REF(setup_hvh_damage))

/datum/ammo/bullet/tank/minigun/proc/setup_hvh_damage()
SIGNAL_HANDLER
if(MODE_HAS_FLAG(MODE_FACTION_CLASH))
damage = 15
/datum/ammo/bullet/tank/setup_faction_clash_values()
. = ..()
damage = 15
7 changes: 6 additions & 1 deletion code/game/gamemodes/game_mode.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ GLOBAL_VAR_INIT(cas_tracking_id_increment, 0) //this var used to assign unique t
SS.post_setup()
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_MODE_POSTSETUP)
addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(display_roundstart_logout_report)), ROUNDSTART_LOGOUT_REPORT_TIME)

adjust_ammo_values()
for(var/mob/new_player/np in GLOB.new_player_list)
np.new_player_panel_proc()
round_time_lobby = world.time
Expand All @@ -115,6 +115,11 @@ GLOBAL_VAR_INIT(cas_tracking_id_increment, 0) //this var used to assign unique t
log_game("Server IP: [world.internet_address]:[world.port]")
return TRUE

/datum/game_mode/proc/adjust_ammo_values()
for(var/ammo in GLOB.ammo_list)
if(MODE_HAS_FLAG(MODE_FACTION_CLASH))
GLOB.ammo_list[ammo].setup_faction_clash_values()

/datum/game_mode/proc/get_affected_zlevels()
if(is_in_endgame)
. = SSmapping.levels_by_any_trait(list(ZTRAIT_MARINE_MAIN_SHIP))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@

/obj/projectile/proc/get_effective_accuracy()
#if DEBUG_HIT_CHANCE
to_world(SPAN_DEBUG("Base accuracy is <b>[accuracy]</b>; scatter: <b>[scatter]</b>; distance: <b>[distance_travelled]</b>"))
to_world(SPAN_DEBUG("Base accuracy is <b>[accuracy]</b>; scatter: <b>[scatter]</b>;accurate_range: <b>[ammo.accurate_range]<b>; distance: <b>[distance_travelled]</b>"))
#endif

var/effective_accuracy = accuracy //We want a temporary variable so accuracy doesn't change every time the bullet misses.
Expand Down

0 comments on commit 35c2780

Please sign in to comment.