Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DELETE: Gategun MK2 #597

Closed
wants to merge 6 commits into from
Closed
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 11 additions & 33 deletions modular_ss220/awaymission_gun/code/items/awaymission_gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,13 @@
origin_tech = "combat=5;magnets=3;powerstorage=4"
selfcharge = TRUE // Selfcharge is enabled and disabled, and used as the away mission tracker
can_charge = 0
emagged = FALSE

/obj/item/gun/energy/laser/awaymission_aeg/Initialize(mapload)
. = ..()
// Force update it incase it spawns outside an away mission and shouldnt be charged
onTransitZ(new_z = loc.z)

/obj/item/gun/energy/laser/awaymission_aeg/onTransitZ(old_z, new_z)
ErdGinalD marked this conversation as resolved.
Show resolved Hide resolved
if(emagged)
return

if(is_away_level(new_z))

Check failure on line 19 in modular_ss220/awaymission_gun/code/items/awaymission_gun.dm

View workflow job for this annotation

GitHub Actions / Run Linters

undefined var: "new_z"
if(ismob(loc))
to_chat(loc, span_notice("Ваш [name] активируется, начиная потреблять энергию от ближайшего беспроводного источника питания."))
selfcharge = TRUE
Expand All @@ -38,35 +33,13 @@
var/mob/M = loc
M.unEquip(src)

/obj/item/gun/energy/laser/awaymission_aeg/emag_act(mob/user)
. = ..()
if(emagged)
return
if(user)
if(prob(50))
user.visible_message(span_warning("От [name] летят искры!"), span_notice("Вы взломали [name], что привело к перезаписи протоколов безопасности. Устройство может быть использовано вне ограничений"))
playsound(loc, 'sound/effects/sparks4.ogg', 30, 1)
do_sparks(5, 1, src)
emagged = TRUE
selfcharge = TRUE
else
user.visible_message(span_warning("От [name] летят искры... Он сейчас взорвётся!"), span_notice("Ой... Что-то пошло не так!"))
do_sparks(5, 1, src)
update_mob()
explosion(loc, -1, 0, 2)
qdel(src)

/obj/item/gun/energy/laser/awaymission_aeg/emp_act(severity)
. = ..()
emag_act()

// GUNS
/obj/item/gun/energy/laser/awaymission_aeg/rnd
name = "Exploreverse Mk I"
desc = "Первый прототип оружия с миниатюрным реактором для исследований в крайне отдаленных секторах. \
\nДанную модель невозможно подключить к зарядной станции, во избежание истощения подключенных источников питания, \
в связи с протоколами безопасности, опустошающие заряд при нахождении вне предназначенных мест использования устройств."
origin_tech = "combat=3;magnets=3;powerstorage=4"
origin_tech = "combat=2;magnets=2;powerstorage=3"
force = 10

/obj/item/gun/energy/laser/awaymission_aeg/rnd/mk2
Expand All @@ -78,12 +51,14 @@
опустошающие заряд при нахождении вне предназначенных мест использования устройств. \
\nТеперь еще более нелепый дизайн с торчащими проводами!"
icon_state = "laser_gate_mk2"
origin_tech = "combat=5;magnets=3;powerstorage=5;programming=3;engineering=5"
origin_tech = "combat=3;magnets=2;powerstorage=4;programming=2;engineering=4"
force = 10

/obj/item/gun/energy/laser/awaymission_aeg/rnd/mk2/attack_self(mob/living/user)
var/msg_for_all = span_warning("[user.name] усердно давит на рычаг зарядки [name], но он не поддается!")
var/msg_for_user = span_notice("Вы пытаетесь надавить на рычаг зарядки [name], но он заблокирован.")
var/msg_recharge_all = span_notice("[user.name] усердно давит на рычаг зарядки [name]...")
var/msg_recharge_user = span_notice("Вы со всей силы давите на рычаг зарядки [name], пытаясь зарядить её...")
ErdGinalD marked this conversation as resolved.
Show resolved Hide resolved

if(!is_away_level(loc.z) && !emagged)
user.visible_message(msg_for_all, msg_for_user)
Expand All @@ -93,14 +68,17 @@
user.visible_message(msg_for_all, msg_for_user)
return FALSE

if(user.nutrition <= NUTRITION_LEVEL_HYPOGLYCEMIA)
if(user.nutrition <= NUTRITION_LEVEL_STARVING)
user.visible_message(span_warning("[user.name] слабо давит на [name], но он ослаб!"), span_notice("Вы пытаетесь надавить на рычаг зарядки [name], но не можете из-за усталости!"))
return FALSE

user.visible_message(msg_recharge_all, msg_recharge_user)
playsound(loc, 'sound/effects/sparks3.ogg', 10, 1)
do_sparks(1, 1, src)

cell.give(25)
user.adjust_nutrition(-2)
if(!do_after_once(user, 3 SECONDS, target = src))
ErdGinalD marked this conversation as resolved.
Show resolved Hide resolved
return
cell.give(166)
on_recharge()
user.adjust_nutrition(-25)

ErdGinalD marked this conversation as resolved.
Show resolved Hide resolved
. = ..()
Loading