Skip to content

Commit

Permalink
Merge pull request #94 from Lhars/guns
Browse files Browse the repository at this point in the history
Gun bug fixes
  • Loading branch information
TheGreatKitsune authored Dec 4, 2024
2 parents a21cc27 + fc74025 commit e7bb75d
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 14 deletions.
59 changes: 47 additions & 12 deletions code/game/objects/items/rogueweapons/ranged/gunpowder/ammo.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@
woundclass = BCLASS_STAB
flag = "bullet"

/obj/projectile/bullet/reusable/runelock/on_hit(atom/target, blocked = FALSE)
. = ..()

var/mob/living/L = firer
if(!L || !L.mind) return

var/skill_multiplier = 0

if(isliving(target)) // If the target theyre shooting at is a mob/living
var/mob/living/T = target
if(T.stat != DEAD) // If theyre alive
skill_multiplier = 4
if(skill_multiplier && can_train_combat_skill(L, /datum/skill/combat/firearms, SKILL_LEVEL_EXPERT))
L.mind.add_sleep_experience(/datum/skill/combat/firearms, L.STAINT * skill_multiplier)
if(istype(target, /mob/living/carbon/human))
var/mob/living/carbon/human/M = target
var/list/screams = list("painscream", "paincrit")
var/check = rand(1, 20)
if(isliving(target))
if(check > M.STACON)
M.emote(screams)
M.Knockdown(rand(15,30))
M.Immobilize(rand(30,60))

/**
* Generic ammo used by handgonnes and arquebuses
*/
Expand All @@ -50,8 +74,30 @@
armor_penetration = 75
speed = 0.1

/obj/projectile/bullet/rogue/on_hit(atom/target, blocked = FALSE)
/obj/item/ammo_casing/caseless/lead
name = "lead sphere"
desc = "A small lead sphere. This should go well with gunpowder."
projectile_type = /obj/projectile/bullet/lead
caliber = "lead_sphere"
icon = 'icons/roguetown/weapons/ammo.dmi'
icon_state = "musketball"
dropshrink = 0.5
max_integrity = 0.1

/obj/projectile/bullet/lead/on_hit(atom/target, blocked = FALSE)
. = ..()

var/mob/living/L = firer
if(!L || !L.mind) return

var/skill_multiplier = 0

if(isliving(target)) // If the target theyre shooting at is a mob/living
var/mob/living/T = target
if(T.stat != DEAD) // If theyre alive
skill_multiplier = 4
if(skill_multiplier && can_train_combat_skill(L, /datum/skill/combat/firearms, SKILL_LEVEL_EXPERT))
L.mind.add_sleep_experience(/datum/skill/combat/firearms, L.STAINT * skill_multiplier)
if(istype(target, /mob/living/carbon/human))
var/mob/living/carbon/human/M = target
var/list/screams = list("painscream", "paincrit")
Expand All @@ -61,14 +107,3 @@
M.emote(screams)
M.Knockdown(rand(15,30))
M.Immobilize(rand(30,60))


/obj/item/ammo_casing/caseless/lead
name = "lead sphere"
desc = "A small lead sphere. This should go well with gunpowder."
projectile_type = /obj/projectile/bullet/lead
caliber = "lead_sphere"
icon = 'icons/roguetown/weapons/ammo.dmi'
icon_state = "musketball"
dropshrink = 0.5
max_integrity = 0.1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
//pickup_sound = 'sound/sheath_sounds/draw_from_holster.ogg'
//sheathe_sound = 'sound/sheath_sounds/put_back_to_holster.ogg'
var/spread_num = 10
var/damfactor = 2
var/damfactor = 2.5
var/reloaded = FALSE
var/load_time = 50
var/gunpowder = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
spread = 150 - (150 * (user.client.chargedprog / 100))
else
spread = 0
for(var/obj/item/ammo_casing/CB in get_ammo_list(FALSE, TRUE))
var/obj/projectile/BB = CB.BB
BB.damage = BB.damage * damfactor
gunpowder = FALSE
reloaded = FALSE
spark_act()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@
spread = 150 - (150 * (user.client.chargedprog / 100))
else
spread = 0
for(var/obj/item/ammo_casing/CB in get_ammo_list(FALSE, TRUE))
var/obj/projectile/BB = CB.BB
BB.damage = BB.damage * damfactor
gunpowder = FALSE
reloaded = FALSE
spark_act()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
/// Reload time, in SECONDS
var/reload_time = 10
//weapon_embed_chance = 100 //this was here to make a weaker version of the gun, didn't do it, still keeping this here to be used
var/damfactor = 5
var/damfactor = 2

/obj/item/gun/ballistic/revolver/grenadelauncher/runelock/getonmobprop(tag)
. = ..()
Expand Down Expand Up @@ -81,6 +81,9 @@
explosion(src, light_impact_range = 2, heavy_impact_range = 1, smoke = TRUE, soundin = 'sound/misc/explode/bomb.ogg')
qdel(src)
return
for(var/obj/item/ammo_casing/CB in get_ammo_list(FALSE, TRUE))
var/obj/projectile/BB = CB.BB
BB.damage = BB.damage * damfactor
cocked = FALSE
icon_state = initial(icon_state)
var/dir = get_dir(src, target)
Expand Down

0 comments on commit e7bb75d

Please sign in to comment.