Implements all-species positive and negative traits

This commit is contained in:
Heroman
2022-06-28 18:08:34 +10:00
parent bef09bca2f
commit 10d0c34755
21 changed files with 160 additions and 47 deletions
+7 -1
View File
@@ -651,6 +651,12 @@
if(!isnull(M.accuracy_dispersion))
P.dispersion = max(P.dispersion + M.accuracy_dispersion, 0)
if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.species)
P.accuracy += H.species.gun_accuracy_mod
P.dispersion = max(P.dispersion + H.species.gun_accuracy_dispersion_mod, 0)
//does the actual launching of the projectile
/obj/item/weapon/gun/proc/process_projectile(obj/projectile, mob/user, atom/target, var/target_zone, var/params=null)
var/obj/item/projectile/P = projectile
@@ -788,7 +794,7 @@
return ..()
/obj/item/weapon/gun/dropped(mob/living/user) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti.
/obj/item/weapon/gun/dropped(mob/living/user) // Ditto as above, we remove the HUD. Pending porting TGMC code to clean up this fucking nightmare of spaghetti.
user.hud_used.remove_ammo_hud(user, src)
..()
@@ -17,6 +17,8 @@
combustion = FALSE
can_miss = FALSE
muzzle_type = /obj/effect/projectile/muzzle/medigun
tracer_type = /obj/effect/projectile/tracer/medigun
impact_type = /obj/effect/projectile/impact/medigun
+3 -2
View File
@@ -40,6 +40,7 @@
var/ricochets = 0
var/ricochets_max = 2
var/ricochet_chance = 30
var/can_miss = TRUE
//Hitscan
var/hitscan = FALSE //Whether this is hitscan. If it is, speed is basically ignored.
@@ -139,7 +140,7 @@
var/impact_effect_type = null
var/list/impacted_mobs = list()
// TGMC Ammo HUD Port
var/hud_state = "unknown" // What HUD state we use when we have ammunition.
var/hud_state_empty = "unknown" // The empty state. DON'T USE _FLASH IN THE NAME OF THE EMPTY STATE STRING, THAT IS ADDED BY THE CODE.
@@ -655,7 +656,7 @@
//roll to-hit
miss_modifier = max(15*(distance-2) - accuracy + miss_modifier + target_mob.get_evasion(), -100)
var/hit_zone = get_zone_with_miss_chance(def_zone, target_mob, miss_modifier, ranged_attack=(distance > 1 || original != target_mob)) //if the projectile hits a target we weren't originally aiming at then retain the chance to miss
var/hit_zone = get_zone_with_miss_chance(def_zone, target_mob, miss_modifier, ranged_attack=(distance > 1 || original != target_mob), force_hit = !can_miss) //if the projectile hits a target we weren't originally aiming at then retain the chance to miss
var/result = PROJECTILE_FORCE_MISS
if(hit_zone)