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

Чемоданчик #11398

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
93 changes: 65 additions & 28 deletions code/game/objects/random/random_misc.dm
Expand Up @@ -162,26 +162,81 @@
prob(100);pick(typesof(/obj/item/weapon/disk/smartlight_programm))
)

/obj/random/misc/storage
name = "Random Bag/Box/Case"
/obj/random/misc/mine/wallet
name = "Random Wallet"
desc = "Кошелёк с миной или обычными деньгами."
icon = 'icons/obj/storage.dmi'
icon_state = "wallet"

/obj/random/misc/mine/wallet/item_to_spawn()
return /obj/item/weapon/storage/wallet

/obj/random/misc/mine/wallet/spawn_item()
var/obj/item/weapon/storage/Bag = ..()

Check failure on line 175 in code/game/objects/random/random_misc.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

proc has no parent: /obj/random/misc/mine/wallet/proc/spawn_item

if(prob(30))
new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
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.

5 гранат по 30 ломают человека но не ломают тайлы.

Copy link
Contributor

Choose a reason for hiding this comment

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

а 1 граната не ломает?

Copy link
Contributor

Choose a reason for hiding this comment

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

ну и в любом случае заменить на

for(var/i in 1 to количество)
    new граната

new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
else
spawn_money(300, Bag)

/obj/random/misc/mine/box_pouch
name = "Random Box"
desc = "Случайная коробка с миной или обычными предметами."
icon = 'icons/obj/storage.dmi'
icon_state = "box"

/obj/random/misc/mine/box_pouch/item_to_spawn()
return pick(\
prob(20);/obj/item/weapon/storage/pouch/medium_generic,\
prob(100);/obj/item/weapon/storage/box,
)

/obj/random/misc/mine/box_pouch/spawn_item()
var/obj/item/weapon/storage/Bag = ..()

Check failure on line 199 in code/game/objects/random/random_misc.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

proc has no parent: /obj/random/misc/mine/box_pouch/proc/spawn_item

if(prob(30))
new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
else
for(var/i = 0, i < 4, i++)
var/itemtype = pick(\
prob(25);/obj/random/foods/food_snack,\
prob(25);/obj/random/foods/drink_can,\
prob(25);/obj/random/misc/cigarettes,\
prob(25);/obj/random/misc/lightsource,\
prob(25);/obj/random/misc/lighters,\
prob(25);/obj/random/meds/pills,\
prob(25);pick(typesof(/obj/item/device/camera) - /obj/item/device/camera/siliconcam),\
prob(20);/obj/item/weapon/storage/wallet/random,\
prob(15);/obj/item/weapon/reagent_containers/spray/pepper,\
prob(10);/obj/item/device/flash,
)
new itemtype(Bag)

/obj/random/misc/mine/backpack_satchel
name = "Random Bag/Case"
desc = "Случайная сумка с миной или обычными предметами."
icon = 'icons/obj/storage.dmi'
icon_state = "briefcase"

/obj/random/misc/storage/item_to_spawn()
/obj/random/misc/mine/backpack_satchel/item_to_spawn()
return pick(\
prob(30);/obj/item/weapon/storage/briefcase,\
prob(30);/obj/item/weapon/storage/backpack/alt,\
prob(30);/obj/item/weapon/storage/backpack,\
prob(30);/obj/item/weapon/storage/backpack/satchel,\
prob(30);/obj/item/weapon/storage/backpack/satchel/norm,\
prob(20);/obj/item/weapon/storage/pouch/medium_generic,\
prob(10);/obj/item/weapon/storage/box,\
prob(5);/obj/item/weapon/storage/wallet,
prob(100);/obj/item/weapon/storage/backpack/satchel/norm,
)

/obj/random/misc/storage/spawn_item()
/obj/random/misc/mine/backpack_satchel/spawn_item()
var/obj/item/weapon/storage/Bag = ..()

Check failure on line 239 in code/game/objects/random/random_misc.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

proc has no parent: /obj/random/misc/mine/backpack_satchel/proc/spawn_item
LudwigVonChesterfield marked this conversation as resolved.
Show resolved Hide resolved

if(prob(30))
Copy link
Contributor

Choose a reason for hiding this comment

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

тут и везде переписать на вид

if(prob(30))
    ...
    return

for ...
    ...

(т.н. "ранний возврат")

new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
Expand All @@ -191,25 +246,7 @@
new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
else
for(var/i = 0, i < 4, i++)
var/itemtype
if(istype(Bag, /obj/item/weapon/storage/box) || istype(Bag, /obj/item/weapon/storage/pouch/medium_generic))
itemtype = pick(\
prob(25);/obj/random/foods/food_snack,\
prob(25);/obj/random/foods/drink_can,\
prob(25);/obj/random/misc/cigarettes,\
prob(25);/obj/random/misc/lightsource,\
prob(25);/obj/random/misc/lighters,\
prob(25);/obj/random/meds/pills,\
prob(25);pick(typesof(/obj/item/device/camera) - /obj/item/device/camera/siliconcam),\
prob(20);/obj/item/weapon/storage/wallet/random,\
prob(15);/obj/item/weapon/reagent_containers/spray/pepper,\
prob(10);/obj/item/device/flash,
)
else if(istype(Bag, /obj/item/weapon/storage/wallet))
spawn_money(300, Bag)
return
else
itemtype = pick(\
var/itemtype = pick(\
prob(25);/obj/random/foods/food_snack,\
prob(25);/obj/random/foods/drink_can,\
prob(25);/obj/random/misc/cigarettes,\
Expand All @@ -223,11 +260,11 @@
prob(20);/obj/item/weapon/storage/wallet/random,\
prob(15);/obj/item/weapon/reagent_containers/spray/pepper,\
prob(10);/obj/item/device/flash,\
prob(5);/obj/item/weapon/gun/projectile/automatic/glock

Check failure on line 263 in code/game/objects/random/random_misc.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

failed to resolve path /obj/item/weapon/gun/projectile/automatic/glock
)
new itemtype(Bag)

/obj/random/misc/storage/mine
/obj/random/misc/mine
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.

так на картинке с ней будет сумка. так что явно будет понятно что это рандомная коробка с миной

Copy link
Contributor

Choose a reason for hiding this comment

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

названия важны. в названии написано что это мина а не сумка с миной. напиши что это сумка с миной

name = "Random Bag/Box/Case with mine"
desc = "Случайная сумка с миной."
icon = 'icons/obj/storage.dmi'
Expand All @@ -246,7 +283,7 @@
)

/obj/random/misc/storage/mine/spawn_item()
var/obj/item/weapon/storage/Bag = ..()

Check failure on line 286 in code/game/objects/random/random_misc.dm

View workflow job for this annotation

GitHub Actions / DreamChecker

proc has no parent: /obj/random/misc/storage/mine/proc/spawn_item

new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
new /obj/item/weapon/grenade/chem_grenade/mine(Bag)
Expand Down
5 changes: 3 additions & 2 deletions code/modules/events/roundstart_events/area/satchelmine.dm
Expand Up @@ -9,11 +9,12 @@
var/list/tables = list()
for(var/obj/structure/table/Table in target_area)
tables += Table
var/Mine = pick(/obj/random/misc/mine/wallet, /obj/random/misc/mine/box_pouch, /obj/random/misc/mine/backpack_satchel)
if(tables.len)
var/obj/structure/table/Table = pick(tables)
var/turf/T = get_turf(Table)
new /obj/random/misc/storage(T)
new Mine(T)
else
var/list/turf/all_turfs = get_area_turfs(target_area, TRUE, black_list=list(/turf/simulated/wall, /turf/simulated/wall/r_wall))
var/turf/T = pick(all_turfs)
new /obj/random/misc/storage(T)
new Mine(T)