Uranium eating aegun, second try (#17582)

* new aegun

* it just work

* Update code/modules/projectiles/guns/energy/energy_gun.dm

Co-authored-by: Molti <108117184+Moltijoe@users.noreply.github.com>

* Add files via upload

* dfuisqbdusq

---------

Co-authored-by: Molti <108117184+Moltijoe@users.noreply.github.com>
This commit is contained in:
00ze-cyclone
2023-02-06 16:52:48 +01:00
committed by GitHub
parent 498e4e6ae4
commit 8df29b5392
3 changed files with 30 additions and 51 deletions

View File

@@ -49,8 +49,8 @@
cell = new cell_type(src)
else
cell = new(src)
if(!dead_cell)
cell.give(cell.maxcharge)
if(dead_cell)
cell.charge = 0
update_ammo_types()
recharge_newshot(TRUE)
if(selfcharge)

View File

@@ -132,61 +132,40 @@
/obj/item/gun/energy/e_gun/nuclear
name = "advanced energy gun"
desc = "An energy gun with an experimental miniaturized nuclear reactor that automatically charges the internal power cell."
desc = "An experimental energy gun with many settings and a miniaturized nuclear reactor that can be refueled with uranium."
icon_state = "nucgun"
item_state = "nucgun"
charge_delay = 10
pin = null
can_charge = FALSE
ammo_x_offset = 1
ammo_type = list(/obj/item/ammo_casing/energy/laser, /obj/item/ammo_casing/energy/disabler)
selfcharge = 1
var/reactor_overloaded
var/fail_tick = 0
var/fail_chance = 0
old_ratio = 1
ammo_type = list(/obj/item/ammo_casing/energy/disabler, /obj/item/ammo_casing/energy/laser, /obj/item/ammo_casing/energy/xray, /obj/item/ammo_casing/energy/anoxia) //a lot of firemodes so it's really an ADVANCED egun
dead_cell = TRUE //Fuel not included, you will have to get irradiated to shoot this gun
/obj/item/gun/energy/e_gun/nuclear/process(delta_time)
if(fail_tick > 0)
fail_tick -= delta_time * 0.5
..()
/obj/item/gun/energy/e_gun/nuclear/shoot_live_shot(mob/living/user, pointblank = 0, atom/pbtarget = null, message = 1)
failcheck()
update_icon()
..()
/obj/item/gun/energy/e_gun/nuclear/proc/failcheck()
if(prob(fail_chance) && isliving(loc))
var/mob/living/M = loc
switch(fail_tick)
if(0 to 200)
fail_tick += (2*(fail_chance))
M.rad_act(40)
to_chat(M, span_userdanger("Your [name] feels warmer."))
if(201 to INFINITY)
SSobj.processing.Remove(src)
M.rad_act(80)
reactor_overloaded = TRUE
to_chat(M, span_userdanger("Your [name]'s reactor overloads!"))
/obj/item/gun/energy/e_gun/nuclear/emp_act(severity)
. = ..()
if(. & EMP_PROTECT_SELF)
/obj/item/gun/energy/e_gun/nuclear/attackby(obj/item/I, mob/living/carbon/user) //plasmacutter but using uranium and devoid of any safety measures
var/charge_multiplier = 0 //2 = Refined stack, 1 = Ore
var/previous_loc = user.loc
if(istype(I, /obj/item/stack/sheet/mineral/uranium))
charge_multiplier = 2
if(istype(I, /obj/item/stack/ore/uranium))
charge_multiplier = 1
if(charge_multiplier)
if(cell.charge == cell.maxcharge)
to_chat(user, span_notice("You try to insert [I] into [src]'s nulear reactor, but it's full."))
return
fail_chance = min(fail_chance + round(15/severity), 100)
/obj/item/gun/energy/e_gun/nuclear/update_icon()
..()
if(reactor_overloaded)
add_overlay("[icon_state]_fail_3")
to_chat(user, span_notice("You start delicately inserting [I] in [src]'s reactor, refueling it."))
if(do_after(user, 1 SECONDS, src))
I.use(1)
cell.give(250*charge_multiplier)
user.radiation += (75*charge_multiplier) //You are putting you hand into a nuclear reactor to put more uranium in it
update_icon(TRUE)
else
switch(fail_tick)
if(0)
add_overlay("[icon_state]_fail_0")
if(1 to 150)
add_overlay("[icon_state]_fail_1")
if(151 to INFINITY)
add_overlay("[icon_state]_fail_2")
if(!(previous_loc == user.loc))
to_chat(user, span_boldwarning("You move, bumping your hand on [src]'s nulear reactor's core!")) //when I said devoid of ANY safety measures I meant it
user.adjustToxLoss(5*charge_multiplier) //straigth toxin damage rather than rads because we want the user to be punished immediately for moving, not in 2 hours
user.radiation += (100*charge_multiplier) //but also rads because you touched a fucking nuclear reactor's core
else
..()
/obj/item/gun/energy/e_gun/bouncer
name = "bouncer energy gun"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 43 KiB