mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Co-authored-by: Changelogs <action@github.com> Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com> Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com> Co-authored-by: Kashargul <KashL@t-online.de>
157 lines
5.2 KiB
Plaintext
157 lines
5.2 KiB
Plaintext
/obj/item/gun/proc/describe_firepower()
|
|
var/obj/item/projectile/P
|
|
if(istype(src, /obj/item/gun/energy))
|
|
var/obj/item/gun/energy/energy_gun = src
|
|
P = new energy_gun.projectile_type()
|
|
else if(istype(src, /obj/item/gun/projectile/shotgun/pump))
|
|
var/obj/item/gun/projectile/shotgun/pump/projectile_gun = src
|
|
if(isnull(projectile_gun.chambered) || isnull(projectile_gun.chambered.BB))
|
|
return "no"
|
|
else
|
|
var/obj/item/ammo_casing/ammo = projectile_gun.chambered
|
|
P = ammo.BB
|
|
else if(istype(src, /obj/item/gun/projectile))
|
|
var/obj/item/gun/projectile/projectile_gun = src
|
|
var/obj/item/ammo_casing/ammo
|
|
if(projectile_gun.ammo_magazine)
|
|
ammo = projectile_gun.ammo_magazine.contents[1]
|
|
else
|
|
ammo = projectile_gun.contents[1]
|
|
P = ammo.BB
|
|
if(!P)
|
|
return "no"
|
|
switch(P.damage)
|
|
if(0)
|
|
return "no"
|
|
if(1 to 5)
|
|
return "a very small amount of"
|
|
if(6 to 15)
|
|
return "a small amount of"
|
|
if(16 to 25)
|
|
return "a modest amount of"
|
|
if(26 to 40)
|
|
return "a respectable amount of"
|
|
if(41 to 60)
|
|
return "a serious amount of"
|
|
if(61 to 80)
|
|
return "a lot of"
|
|
if(81 to 2000)
|
|
return "a ruinous amount of"
|
|
qdel(P)
|
|
|
|
/obj/item/gun/proc/describe_proj_penetration()
|
|
var/obj/item/projectile/P
|
|
if(istype(src, /obj/item/gun/energy))
|
|
var/obj/item/gun/energy/energy_gun = src
|
|
P = new energy_gun.projectile_type()
|
|
else if(istype(src, /obj/item/gun/projectile/shotgun/pump))
|
|
var/obj/item/gun/projectile/shotgun/pump/projectile_gun = src
|
|
if(isnull(projectile_gun.chambered) || isnull(projectile_gun.chambered.BB))
|
|
return "as it has no projectile loaded"
|
|
else
|
|
var/obj/item/ammo_casing/ammo = projectile_gun.chambered
|
|
P = ammo.BB
|
|
else if(istype(src, /obj/item/gun/projectile))
|
|
var/obj/item/gun/projectile/projectile_gun = src
|
|
var/obj/item/ammo_casing/ammo
|
|
if(projectile_gun.ammo_magazine)
|
|
ammo = projectile_gun.ammo_magazine.contents[1]
|
|
else
|
|
ammo = projectile_gun.contents[1]
|
|
P = ammo.BB
|
|
if(!P)
|
|
return "no"
|
|
switch(P.armor_penetration)
|
|
if(0)
|
|
return "cannot pierce armor"
|
|
if(1 to 20)
|
|
return "barely pierces armor"
|
|
if(21 to 30)
|
|
return "slightly pierces armor"
|
|
if(31 to 40)
|
|
return "reliably pierces lighter armors"
|
|
if(41 to 50)
|
|
return "pierces standard-issue armor reliably"
|
|
if(51 to 60)
|
|
return "pierces most armor reliably"
|
|
if(61 to 70)
|
|
return "pierces a great deal of armor"
|
|
if(71 to 80)
|
|
return "pierces the vast majority of armor"
|
|
if(81 to 99)
|
|
return "almost completely pierces all armor"
|
|
if(100 to 1000)
|
|
return "completely and utterly pierces all armor"
|
|
qdel(P)
|
|
|
|
/obj/item/gun/proc/describe_firerate()
|
|
switch(fire_delay)
|
|
if(0)
|
|
return "no delay"
|
|
if(1 to 4)
|
|
return "a very short delay"
|
|
if(5 to 8)
|
|
return "a short delay"
|
|
if(9 to 12)
|
|
return "a moderate delay"
|
|
if(13 to 15)
|
|
return "a noticeable delay"
|
|
if(16 to 20)
|
|
return "a distinct delay"
|
|
if(21 to 30)
|
|
return "a long delay"
|
|
if(31 to 50)
|
|
return "a very long delay"
|
|
if(51 to 100)
|
|
return "an extremely long delay"
|
|
|
|
/obj/item/gun/get_description_info()
|
|
var/is_loaded
|
|
var/non_lethal
|
|
var/non_lethal_list = list(/obj/item/gun/energy/medigun,/obj/item/gun/energy/mouseray,/obj/item/gun/energy/temperature,/obj/item/gun/energy/sizegun,/obj/item/gun/projectile/shotgun/pump/toy,/obj/item/gun/projectile/revolver/toy,/obj/item/gun/projectile/pistol/toy,/obj/item/gun/projectile/automatic/toy)
|
|
var/less_lethal
|
|
var/less_lethal_list = list(/obj/item/gun/energy/taser,/obj/item/gun/energy/stunrevolver,/obj/item/gun/energy/plasmastun,/obj/item/gun/energy/bfgtaser)
|
|
var/weapon_stats = description_info + "\
|
|
<br>"
|
|
if(istype(src, /obj/item/gun/energy))
|
|
is_loaded = LAZYLEN(src.contents)
|
|
if(istype(src, /obj/item/gun/projectile/shotgun/pump))
|
|
var/obj/item/gun/projectile/shotgun/pump/shotgun = src
|
|
if(isnull(shotgun.chambered) || isnull(shotgun.chambered.BB))
|
|
is_loaded = null
|
|
else
|
|
is_loaded = shotgun.chambered
|
|
if(istype(src, /obj/item/gun/projectile))
|
|
var/obj/item/gun/projectile/projectile_gun = src
|
|
var/ammo
|
|
if(projectile_gun.ammo_magazine)
|
|
ammo = projectile_gun.ammo_magazine.contents
|
|
else
|
|
ammo = projectile_gun.contents
|
|
is_loaded = LAZYLEN(ammo)
|
|
for(var/llweapontype in less_lethal_list)
|
|
if(istype(src,llweapontype))
|
|
is_loaded = null
|
|
less_lethal = TRUE
|
|
for(var/nlweapontype in non_lethal_list)
|
|
if(istype(src,nlweapontype))
|
|
is_loaded = null
|
|
non_lethal = TRUE
|
|
|
|
if(is_loaded)
|
|
weapon_stats += "\nIf fired, it would deal [describe_firepower()] damage, [describe_proj_penetration()], and has [describe_firerate()] between shots."
|
|
else if(less_lethal)
|
|
weapon_stats += "\nIf fired, it would deal stunning damage to incapacitate targets, and has [describe_firerate()] between shots."
|
|
else if(non_lethal)
|
|
weapon_stats += "\nThis is an entirely non-lethal weapon, such as a mouseray, toy, or sizegun! Its effects cannot easily be quantified."
|
|
else
|
|
weapon_stats += "\nIt isn't loaded!"
|
|
if(force)
|
|
weapon_stats += "\nIf used in melee, it deals [describe_power()] [sharp ? "sharp" : "blunt"] damage, [describe_penetration()], and has [describe_speed()]."
|
|
if(can_cleave)
|
|
weapon_stats += "\nIt is capable of hitting multiple targets with a single swing."
|
|
if(reach > 1)
|
|
weapon_stats += "\nIt can attack targets up to [reach] tiles away, and can attack over certain objects."
|
|
|
|
return weapon_stats
|