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

Добавление новых механик зажигалке синидката #13355

Closed
wants to merge 6 commits into from
6 changes: 6 additions & 0 deletions code/datums/uplinks_items.dm
Riverz1 marked this conversation as resolved.
Show resolved Hide resolved
Riverz1 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,12 @@
item = /obj/item/weapon/storage/fancy/cigarettes/cigpack_syndicate
cost = 2

/datum/uplink_item/badass/item/weapon/weldingtool/experimental/syndicate_zippo
name = "Syndicate Zippo"
desc = "A very cool zippo and welder"
item = /obj/item/weapon/weldingtool/experimental/syndicate_zippo
cost = 4

/datum/uplink_item/badass/syndiedonuts
name = "Syndicate Donuts"
desc = "Special offer from Waffle Co., the box of 6 delicious donuts! But be careful, some of them are posioned!"
Expand Down
3 changes: 2 additions & 1 deletion code/game/machinery/vending/other.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
)
syndie = list(
/obj/item/weapon/storage/fancy/cigarettes/cigpack_syndicate = 1,
/obj/item/weapon/weldingtool/experimental/syndicate_zippo = 1,
)
prices = list(
/obj/item/weapon/storage/fancy/cigarettes = 20,
Expand Down Expand Up @@ -215,7 +216,7 @@
/obj/item/clothing/head/sushi_band = 1,
/obj/item/weapon/kitchen/utensil/spoon = 2,
/obj/item/weapon/kitchen/rollingpin = 2,
/obj/item/weapon/kitchenknife/butch = 2,
/obj/item/weapon/kitchenknife/butch = 2,
)
syndie = list(
/obj/item/weapon/reagent_containers/glass/bottle/alphaamanitin/syndie = 1,
Expand Down
6 changes: 0 additions & 6 deletions code/game/objects/items/weapons/cigs_lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,3 @@ CIGARETTE PACKETS ARE IN FANCY.DM
location.hotspot_expose(700, 5, src)
return

/obj/item/weapon/lighter/zippo/syndi
icon_state = "syndizippo"
item_state = "syndizippo"
icon_on = "syndizippoon"
icon_off = "syndizippo"
light_color = LIGHT_COLOR_NUKE_OPS
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/storage/uplink_kits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@
name = "chemical fighter kit"
startswith = list(
/obj/item/weapon/reagent_containers/watertank_backpack/syndie,
/obj/item/weapon/lighter/zippo/syndi,
/obj/item/weapon/weldingtool/experimental/syndicate_zippo,
/obj/item/weapon/gun/projectile/revolver/syndie,
/obj/item/ammo_box/speedloader/a357 = 2,
/obj/item/weapon/melee/energy/sword,
Expand Down
40 changes: 40 additions & 0 deletions code/game/objects/items/weapons/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,46 @@
if(!active && (get_fuel() == max_fuel))
STOP_PROCESSING(SSobj, src)

/obj/item/weapon/weldingtool/experimental/syndicate_zippo
icon_state = "syndizippo"
name = "syndicate zippo"
desc = "A very cool zippo"
icon = 'icons/obj/items.dmi'
w_class = SIZE_MINUSCULE
max_fuel = 150
next_refuel_tick = 0

/obj/item/weapon/weldingtool/experimental/syndicate_zippo/process()
if(active)
hitsound = SOUNDIN_LASERACT
if(icon_state != "syndizippo1") // Check that the sprite is correct, if it isnt, it means toggle() was not called
force = 15
damtype = BURN
icon_state = initial(icon_state) + "1"
if(prob(5)) // passive fuel burning
use(1)
light_color = LIGHT_COLOR_NUKE_OPS
set_light(2)
else
hitsound = initial(hitsound)
if(icon_state != "syndizippo") // Check that the sprite is correct, if it isnt, it means toggle() was not called
force = 3
damtype = BRUTE
icon_state = initial(icon_state)
active = FALSE
set_light(0)
if(!istype(src, /obj/item/weapon/weldingtool/experimental/syndicate_zippo))
STOP_PROCESSING(SSobj, src)
return

/obj/item/weapon/weldingtool/experimental/syndicate_zippo/process()
..()
if((get_fuel() < max_fuel) && (next_refuel_tick < world.time) && !active)
next_refuel_tick = world.time + 2.5 SECONDS
reagents.add_reagent("fuel", 1)
if(!active && (get_fuel() == max_fuel))
STOP_PROCESSING(SSobj, src)
Comment on lines +527 to +556
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

зачем на 2 прока разделять?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я сделал это также потому что в экспериментальной сварке также стоит

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

необходим более глубокий анализ, никто не гарантирует что как сделано до тебя - сделано хорошо.

если никакого отличия в поведении между синдикат зажигалкой и экспериментальной сваркой нет - зачем копировать-вставлять поведение?

Copy link
Contributor Author

@Riverz1 Riverz1 Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Потому что это соответствует моей задумке, зажигалка на бензине работающая как сварка, а разница есть в размерах, ну и в получении

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

если есть разница в размерах и получении - это можно поменять, вопросов нет
тут к тебе вопрос по поводу реализации поведения этой зажигалки (в частности прок process)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/TauCetiStation/TauCetiClassic/pull/13355/files#diff-167d286a2ef3b0ebe863f84fdaee23e494da08f0e765bfd6f66274f270066537R527-R556

Есть догадка что если удалить вот эти строки кода то задумка будет осуществлена, а копипаста исчезнет.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

там логика с if(icon_state != "syndizippo1") похерится если наследовать же

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

возможно, надо переделать сварку чтобы нужные переменные менялись при включении-выключении тогда.

но всё ещё не копипастить процесс()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я это оставил потому что у меня зелёный огонь там с помощью этого кода появляется


/*
* Crowbar
*/
Expand Down
Binary file modified icons/mob/inhands/items_lefthand.dmi
Binary file not shown.
Binary file modified icons/mob/inhands/items_righthand.dmi
Binary file not shown.
Binary file modified icons/obj/items.dmi
Binary file not shown.
Loading