Skip to content

Commit

Permalink
prototypes reliability update (#13217)
Browse files Browse the repository at this point in the history
* 14

* and plasma

* Update gun.dmi

* implants, hsuits & beakers

* 111

* Обновил механ изменения икокни от количества пуль

* Не мог не забыть

---------

Co-authored-by: KIBORG04 <[email protected]>
  • Loading branch information
simb11 and KIBORG04 committed Jul 3, 2024
1 parent 169579d commit 025d042
Show file tree
Hide file tree
Showing 9 changed files with 99 additions and 12 deletions.
5 changes: 3 additions & 2 deletions code/game/objects/items/devices/radio/radio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,9 @@ var/global/GLOBAL_RADIO_TYPE = 1 // radio type to use
icon_state = "radio_grid"

/obj/item/device/radio_grid/proc/attach(obj/item/device/radio/radio)
radio.on = TRUE
radio.grid = TRUE
if(prob(reliability))
radio.on = TRUE
radio.grid = TRUE
qdel(src)

/obj/item/device/radio_grid/proc/dettach(obj/item/device/radio/radio)
Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/weapons/implants/implant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,8 @@ var/global/list/death_alarm_stealth_areas = list(
/obj/item/weapon/implant/death_alarm/implanted(mob/source)
mobname = source.real_name
START_PROCESSING(SSobj, src)
if(!prob(reliability))
malfunction = MALFUNCTION_PERMANENT
return 1

/obj/item/weapon/implant/death_alarm/coordinates
Expand Down
5 changes: 3 additions & 2 deletions code/game/objects/items/weapons/implants/implantfreedom.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
desc = "Используйте это, чтоб удрать от злых Красных рубашек."
gender = MALE
var/activation_emote = "blink"
uses = 1.0
uses = 1

implant_type = "r"

/obj/item/weapon/implant/freedom/atom_init()
activation_emote = pick("blink", "eyebrow", "twitch", "frown", "nod", "giggle", "grin", "groan", "shrug", "smile", "sniff", "whimper", "wink")
uses = rand(3, 5)
if(prob(reliability))
uses = rand(3, 5)
. = ..()


Expand Down
2 changes: 2 additions & 0 deletions code/game/objects/items/weapons/implants/mindshield.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
/obj/item/weapon/implant/mind_protect/implanted(mob/M)
if(!ishuman(M) || !M.mind)
return TRUE
if(!prob(reliability))
meltdown()
var/mob/living/carbon/human/H = M
if(isrevhead(H) || isshadowling(H) || isshadowthrall(H)|| iswizard(H))
M.visible_message("<span class='warning'>[M] похоже, сопротивляется имплантату!</span>", "<span class='warning'>Вы чувствуете, что что-то мешает вашим мыслям, но вы сопротивляетесь этому!</span>")
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/random/random_guns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
name = "Random Weapon"
desc = "This is a random weapon."
icon = 'icons/obj/gun.dmi'
icon_state = "saber-18"
icon_state = "saber"
/obj/random/guns/weapon_item/item_to_spawn()
return pick(\
prob(100);/obj/random/guns/energy_weapon,\
Expand Down Expand Up @@ -148,7 +148,7 @@
name = "Random shotgun Weapon with ammunition"
desc = "This is a random weapon."
icon = 'icons/obj/gun.dmi'
icon_state = "saber-18"
icon_state = "saber"
/obj/random/guns/set_shotgun/item_to_spawn()
return pick(\
prob(100);/obj/item/ammo_casing/shotgun/beanbag,\
Expand All @@ -164,7 +164,7 @@
name = "Random lethal Weapon with ammunition"
desc = "This is a random weapon."
icon = 'icons/obj/gun.dmi'
icon_state = "saber-18"
icon_state = "saber"
/obj/random/guns/set_357/item_to_spawn()
return pick(\
prob(200);/obj/item/ammo_casing/a357,\
Expand All @@ -178,7 +178,7 @@
name = "Random lethal Weapon"
desc = "This is a random weapon."
icon = 'icons/obj/gun.dmi'
icon_state = "saber-18"
icon_state = "saber"

/obj/random/guns/set_special/item_to_spawn()
return pick(\
Expand Down
11 changes: 7 additions & 4 deletions code/modules/projectiles/ammunition/magazines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
name = "extended magazine (9mm)"
icon_state = "glock_mag_extended"
max_ammo = 20
overlay = "glock-mag-ex"
overlay = "glock-mag-extended"

/obj/item/ammo_box/magazine/glock/extended/rubber
name = "extended magazine (9mm rubber)"
Expand All @@ -196,14 +196,17 @@

/obj/item/ammo_box/magazine/smg
name = "SMG magazine (9mm)"
icon_state = "smg_mag"
icon_state = "smg_mag-5"
ammo_type = /obj/item/ammo_casing/c9mm
caliber = "9mm"
max_ammo = 18
overlay = "saber-mag"

/obj/item/ammo_box/magazine/smg/update_icon()
..()
icon_state = "[initial(icon_state)]-[round(ammo_count(),3)]"
var/ammo_perc = ammo_count() / max_ammo
var/ammo_state_indx = CEIL(LERP(0, 5, ammo_perc))

icon_state = "smg_mag-[ammo_state_indx]"

/obj/item/ammo_box/magazine/c20r
name = "magazine (.45)"
Expand Down
78 changes: 78 additions & 0 deletions code/modules/research/prototipify.dm
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,84 @@
break
rating = max(rating - 1, 0)

/obj/item/ammo_box/magazine/smg/set_prototype_qualities(rel_val=100, mark=0)
if(mark)
max_ammo *= mark
var/need_bullets = max_ammo - stored_ammo.len
for(var/i in 1 to need_bullets)
stored_ammo += new ammo_type(src)

/obj/item/weapon/gun/energy/set_prototype_qualities(rel_val=100, mark=0)
if(mark)
power_supply.maxcharge += (mark - 1) * 200
fire_delay = max(fire_delay / mark, 4)
if(!prob(reliability))
fire_delay *= 2
power_supply.maxcharge /= 2
power_supply.charge = power_supply.maxcharge

/obj/item/weapon/gun/projectile/automatic/set_prototype_qualities(rel_val=100, mark=0)
if(mark)
recoil = max(recoil / mark, 0.5)
fire_delay = max(fire_delay / mark, 2)
if(!prob(reliability))
fire_delay *= 2
recoil += 1

/obj/item/weapon/gun/plasma/set_prototype_qualities(rel_val=100, mark=0)
if(mark)
number_of_shots = min(number_of_shots * mark, 40)
if(!prob(reliability))
number_of_shots /= 2

/obj/item/weapon/storage/backpack/holding/set_prototype_qualities(rel_val=100, mark=0)
if(mark)
max_storage_space += 10 * (mark - 1)
if(!prob(reliability))
max_storage_space -= 30

/obj/item/weapon/storage/bag/trash/bluespace/set_prototype_qualities(rel_val=100, mark=0)
if(mark)
max_storage_space += 10 * (mark - 1)
if(!prob(reliability))
max_storage_space /= 2

/obj/item/weapon/storage/bag/ore/holding/set_prototype_qualities(rel_val=100, mark=0)
if(mark)
max_storage_space += 25 * (mark - 1)
if(!prob(reliability))
max_storage_space /= 2

/obj/item/clothing/glasses/set_prototype_qualities(rel_val=100, mark=0)
if(!prob(reliability))
hud_types = list(DATA_HUD_BROKEN)

/obj/item/weapon/weldingtool/set_prototype_qualities(rel_val=100, mark=0)
if(mark)
toolspeed -= 0.5 * (mark - 1)
max_fuel *= mark
if(!prob(reliability))
max_fuel /= 2
toolspeed = max(toolspeed + 0.5, 3)

/obj/item/clothing/mask/gas/welding/set_prototype_qualities(rel_val=100, mark=0)
if(!prob(reliability))
flash_protection = FALSE

/obj/item/clothing/suit/space/rig/set_prototype_qualities(rel_val=100, mark=0)
if(mark)
slowdown /= mark
max_mounted_devices += mark - 1
if(!prob(reliability))
slowdown *= 2
max_mounted_devices -= max(max_mounted_devices - 2, 1)

/obj/item/weapon/reagent_containers/glass/beaker/bluespace/set_prototype_qualities(rel_val=100, mark=0)
if(mark)
volume *= mark
if(!prob(reliability))
volume /= mark

#undef PROTOTYPE_ADJECTIVES
#undef PROTOTYPE_DESC_REMARKS

Expand Down
Binary file modified icons/obj/ammo/magazines.dmi
Binary file not shown.
Binary file modified icons/obj/gun.dmi
Binary file not shown.

0 comments on commit 025d042

Please sign in to comment.