mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-16 13:12:22 +00:00
poker chips
This commit is contained in:
committed by
spookerton
parent
246c839123
commit
4a21e3d34d
185
code/game/objects/items/toys/poker_chips.dm
Normal file
185
code/game/objects/items/toys/poker_chips.dm
Normal file
@@ -0,0 +1,185 @@
|
||||
/obj/item/poker_chip
|
||||
name = "poker chip"
|
||||
gender = PLURAL
|
||||
icon = 'icons/obj/poker.dmi'
|
||||
icon_state = "chip1"
|
||||
throw_speed = 3
|
||||
throw_range = 10
|
||||
w_class = ITEMSIZE_TINY
|
||||
drop_sound = 'sound/items/drop/ring.ogg'
|
||||
pickup_sound = 'sound/items/pickup/component.ogg'
|
||||
var/static/list/chip_worths = list(5000, 2000, 1000, 500, 200, 100, 50, 20, 10, 5, 2, 1)
|
||||
var/worth = 0
|
||||
|
||||
|
||||
/obj/item/poker_chip/Initialize(mapload, new_worth)
|
||||
. = ..()
|
||||
if (new_worth)
|
||||
worth = new_worth
|
||||
name = "[worth] poker chip"
|
||||
desc = "A poker chip with a value of [worth]."
|
||||
update_icon()
|
||||
|
||||
|
||||
/obj/item/poker_chip/attackby(obj/item/item, mob/living/user)
|
||||
if (!istype(item, /obj/item/poker_chip))
|
||||
return ..()
|
||||
var/obj/item/poker_chip/chip = item
|
||||
chip.worth += worth
|
||||
chip.update_icon()
|
||||
user.visible_message(
|
||||
SPAN_ITALIC("\The [user] combines some poker chips."),
|
||||
SPAN_ITALIC("You combine some poker chips into a set worth [chip.worth]."),
|
||||
SPAN_ITALIC("You hear the click of plastic on plastic."),
|
||||
range = 5
|
||||
)
|
||||
user.unEquip(src)
|
||||
user.unEquip(chip)
|
||||
user.put_in_hands(chip)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/poker_chip/update_icon()
|
||||
cut_overlays()
|
||||
if (worth in chip_worths)
|
||||
name = "[worth] poker chip"
|
||||
icon_state = "chip[worth]"
|
||||
desc = "A poker chip with a value of [worth]."
|
||||
return
|
||||
name = "poker chips"
|
||||
desc = "Some poker chips with a value of [worth]."
|
||||
var/sum = worth
|
||||
var/list/chip_overlays = list()
|
||||
for (var/chip_worth in chip_worths)
|
||||
for (var/i = 1 to 5)
|
||||
if (sum < chip_worth)
|
||||
break
|
||||
sum -= chip_worth
|
||||
var/image/chip_overlay = image('icons/obj/poker.dmi', "chip[i]")
|
||||
var/matrix/chip_transform = matrix()
|
||||
chip_transform.Translate(rand(-3, 3), rand(-4, 4))
|
||||
chip_transform.Turn(pick(-45, -27.5, 0, 0, 0, 0, 0, 0, 0, 27.5, 45))
|
||||
chip_overlay.transform = chip_transform
|
||||
chip_overlays += chip_overlay
|
||||
if (!length(chip_overlays))
|
||||
chip_overlays += "chip1"
|
||||
add_overlay(chip_overlays)
|
||||
|
||||
|
||||
/obj/item/poker_chip/attack_self(mob/living/user)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
if (user.a_intent != I_HELP)
|
||||
user.visible_message(
|
||||
SPAN_ITALIC("\The [user] kisses \the [src] for luck!"),
|
||||
SPAN_ITALIC("You kiss \the [src] for luck!"),
|
||||
range = 5
|
||||
)
|
||||
return
|
||||
RemoveChip(user)
|
||||
|
||||
|
||||
/obj/item/poker_chip/MouseDrop(mob/living/user)
|
||||
if (user != usr || !istype(user, /mob/living/carbon/human))
|
||||
return
|
||||
var/mob/living/carbon/human/human = user
|
||||
if (!Adjacent(human))
|
||||
return
|
||||
if (human.stat || human.restrained())
|
||||
to_chat(user, SPAN_WARNING("You're in no condition to do that."))
|
||||
return
|
||||
if (human.get_active_hand())
|
||||
to_chat(user, SPAN_WARNING("Your hand is occupied."))
|
||||
return
|
||||
var/obj/item/organ/external/hand = human.organs_by_name[human.hand ? "l_hand" : "r_hand"]
|
||||
if (!hand || !hand.is_usable())
|
||||
to_chat(user, SPAN_WARNING("Your hand is unusable."))
|
||||
return
|
||||
RemoveChip(user)
|
||||
|
||||
|
||||
/obj/item/poker_chip/proc/RemoveChip(mob/living/user)
|
||||
var/biggest_index = 0
|
||||
for (var/i = 1 to length(chip_worths))
|
||||
if (worth > chip_worths[i])
|
||||
biggest_index = i
|
||||
break
|
||||
else if (worth == chip_worths[i])
|
||||
biggest_index = i + 1
|
||||
break
|
||||
if (!biggest_index || biggest_index > length(chip_worths))
|
||||
return
|
||||
var/list/available_chips = chip_worths.Copy(biggest_index)
|
||||
var/amount = input(user, "Available Chips:") as null | anything in available_chips
|
||||
if (QDELETED(src) || !(amount in available_chips) || !Adjacent(user))
|
||||
return
|
||||
worth -= amount
|
||||
update_icon()
|
||||
var/obj/item/poker_chip/chip = new(user.loc, amount)
|
||||
user.put_in_hands(chip)
|
||||
user.visible_message(
|
||||
SPAN_ITALIC("\The [user] picks up a poker chip."),
|
||||
SPAN_ITALIC("You pick up a poker chip worth [amount]."),
|
||||
SPAN_ITALIC("You hear the click of plastic on plastic."),
|
||||
range = 5
|
||||
)
|
||||
|
||||
|
||||
/obj/item/poker_chip/c1
|
||||
icon_state = "chip1"
|
||||
worth = 1
|
||||
|
||||
|
||||
/obj/item/poker_chip/c2
|
||||
icon_state = "chip2"
|
||||
worth = 2
|
||||
|
||||
|
||||
/obj/item/poker_chip/c5
|
||||
icon_state = "chip5"
|
||||
worth = 5
|
||||
|
||||
|
||||
/obj/item/poker_chip/c10
|
||||
icon_state = "chip10"
|
||||
worth = 10
|
||||
|
||||
|
||||
/obj/item/poker_chip/c20
|
||||
icon_state = "chip20"
|
||||
worth = 20
|
||||
|
||||
|
||||
/obj/item/poker_chip/c50
|
||||
icon_state = "chip50"
|
||||
worth = 50
|
||||
|
||||
|
||||
/obj/item/poker_chip/c100
|
||||
icon_state = "chip100"
|
||||
worth = 100
|
||||
|
||||
|
||||
/obj/item/poker_chip/c200
|
||||
icon_state = "chip200"
|
||||
worth = 200
|
||||
|
||||
|
||||
/obj/item/poker_chip/c500
|
||||
icon_state = "chip500"
|
||||
worth = 500
|
||||
|
||||
|
||||
/obj/item/poker_chip/c1000
|
||||
icon_state = "chip1000"
|
||||
worth = 1000
|
||||
|
||||
|
||||
/obj/item/poker_chip/c2000
|
||||
icon_state = "chip2000"
|
||||
worth = 2000
|
||||
|
||||
|
||||
/obj/item/poker_chip/c5000
|
||||
icon_state = "chip5000"
|
||||
worth = 5000
|
||||
@@ -444,6 +444,13 @@
|
||||
icon_state = "mousetraps"
|
||||
starts_with = list(/obj/item/assembly/mousetrap = 7)
|
||||
|
||||
/obj/item/storage/box/poker_chips
|
||||
name = "box of poker chips"
|
||||
desc = "This box contains playing chips."
|
||||
icon = 'icons/obj/storage.dmi'
|
||||
icon_state = "poker_chips"
|
||||
starts_with = list(/obj/item/poker_chip/c5000 = 7)
|
||||
|
||||
/obj/item/storage/box/pillbottles
|
||||
name = "box of pill bottles"
|
||||
desc = "It has pictures of pill bottles on its front."
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
new /datum/stack_recipe("lampshade", /obj/item/lampshade, 1, time = 1, pass_stack_color = TRUE, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("plastic net", /obj/item/material/fishing_net, 25, time = 1 MINUTE, pass_stack_color = TRUE, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("plastic fishtank", /obj/item/glass_jar/fish/plastic, 2, time = 30 SECONDS, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("reagent tubing", /obj/item/stack/hose, 1, 4, 20, pass_stack_color = TRUE, recycle_material = "[name]")
|
||||
new /datum/stack_recipe("reagent tubing", /obj/item/stack/hose, 1, 4, 20, pass_stack_color = TRUE, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("playing chip", /obj/item/poker_chip/c100, 1, 100, 20, pass_stack_color = TRUE, recycle_material = "[name]")
|
||||
)
|
||||
|
||||
/datum/material/cardboard
|
||||
|
||||
0
icons/obj/items.dmi
Normal file → Executable file
0
icons/obj/items.dmi
Normal file → Executable file
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 67 KiB |
BIN
icons/obj/poker.dmi
Normal file
BIN
icons/obj/poker.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 620 B |
Binary file not shown.
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
@@ -1,4 +1,70 @@
|
||||
//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE
|
||||
"aaa" = (
|
||||
/obj/structure/cable{
|
||||
d1 = 2;
|
||||
d2 = 8;
|
||||
icon_state = "2-8"
|
||||
},
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/supply{
|
||||
dir = 10
|
||||
},
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{
|
||||
dir = 10
|
||||
},
|
||||
/obj/machinery/navbeacon/patrol{
|
||||
location = "SEC";
|
||||
next_patrol = "NH1"
|
||||
},
|
||||
/obj/effect/floor_decal/steeldecal/steel_decals_central2,
|
||||
/obj/effect/floor_decal/steeldecal/steel_decals_central6,
|
||||
/obj/item/radio/beacon,
|
||||
/mob/living/bot/secbot/beepsky,
|
||||
/turf/simulated/floor/tiled/monotile,
|
||||
/area/surface/station/hallway/primary/groundfloor/north)
|
||||
"aab" = (
|
||||
/obj/structure/table/woodentable,
|
||||
/obj/item/deck/cah{
|
||||
pixel_x = -3;
|
||||
pixel_y = 3
|
||||
},
|
||||
/obj/item/deck/cah/black{
|
||||
pixel_x = -4;
|
||||
pixel_y = 6
|
||||
},
|
||||
/turf/simulated/floor/carpet,
|
||||
/area/surface/station/library)
|
||||
"aac" = (
|
||||
/obj/structure/table/woodentable,
|
||||
/obj/item/dice,
|
||||
/turf/simulated/floor/carpet,
|
||||
/area/surface/station/library)
|
||||
"aad" = (
|
||||
/obj/structure/cable/green{
|
||||
d2 = 4;
|
||||
icon_state = "0-4"
|
||||
},
|
||||
/obj/machinery/power/apc{
|
||||
dir = 1;
|
||||
name = "north bump";
|
||||
pixel_y = 24
|
||||
},
|
||||
/obj/machinery/light_switch{
|
||||
pixel_x = 12;
|
||||
pixel_y = 24
|
||||
},
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/supply{
|
||||
dir = 4
|
||||
},
|
||||
/obj/item/clothing/suit/storage,
|
||||
/turf/simulated/floor/carpet,
|
||||
/area/surface/station/library)
|
||||
"aae" = (
|
||||
/obj/structure/table/woodentable,
|
||||
/obj/item/storage/box/poker_chips,
|
||||
/obj/item/dice/d20,
|
||||
/obj/item/deck/cards,
|
||||
/turf/simulated/floor/carpet,
|
||||
/area/surface/station/library)
|
||||
"aaT" = (
|
||||
/obj/machinery/atmospherics/unary/vent_pump/on,
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{
|
||||
@@ -4180,18 +4246,6 @@
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers,
|
||||
/turf/simulated/floor/tiled/monotile,
|
||||
/area/surface/station/hallway/primary/groundfloor/east)
|
||||
"bTe" = (
|
||||
/obj/structure/table/woodentable,
|
||||
/obj/item/deck/cah{
|
||||
pixel_x = -3;
|
||||
pixel_y = 3
|
||||
},
|
||||
/obj/item/deck/cah/black{
|
||||
pixel_x = -4;
|
||||
pixel_y = 6
|
||||
},
|
||||
/turf/simulated/floor/carpet,
|
||||
/area/surface/station/library)
|
||||
"bUi" = (
|
||||
/obj/machinery/atmospherics/unary/vent_scrubber/on{
|
||||
dir = 4
|
||||
@@ -14320,12 +14374,6 @@
|
||||
},
|
||||
/turf/simulated/floor/tiled/neutral,
|
||||
/area/surface/station/rnd/research_lockerroom)
|
||||
"gvo" = (
|
||||
/obj/structure/table/woodentable,
|
||||
/obj/item/dice/d20,
|
||||
/obj/item/deck/cards,
|
||||
/turf/simulated/floor/carpet,
|
||||
/area/surface/station/library)
|
||||
"gvD" = (
|
||||
/obj/machinery/door/firedoor/border_only,
|
||||
/obj/effect/decal/cleanable/dirt,
|
||||
@@ -16977,10 +17025,6 @@
|
||||
},
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/surface/station/hallway/primary/groundfloor/north)
|
||||
"hEZ" = (
|
||||
/obj/machinery/mech_recharger,
|
||||
/turf/simulated/floor/tiled/dark,
|
||||
/area/surface/station/garage)
|
||||
"hFe" = (
|
||||
/obj/effect/floor_decal/industrial/warning,
|
||||
/turf/simulated/floor/plating,
|
||||
@@ -37739,25 +37783,6 @@
|
||||
/obj/machinery/light,
|
||||
/turf/simulated/floor/tiled,
|
||||
/area/surface/station/engineering/hallway/reactor)
|
||||
"qCT" = (
|
||||
/obj/structure/cable/green{
|
||||
d2 = 4;
|
||||
icon_state = "0-4"
|
||||
},
|
||||
/obj/machinery/power/apc{
|
||||
dir = 1;
|
||||
name = "north bump";
|
||||
pixel_y = 24
|
||||
},
|
||||
/obj/machinery/light_switch{
|
||||
pixel_x = 12;
|
||||
pixel_y = 24
|
||||
},
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/supply{
|
||||
dir = 4
|
||||
},
|
||||
/turf/simulated/floor/carpet,
|
||||
/area/surface/station/library)
|
||||
"qCU" = (
|
||||
/obj/machinery/mech_recharger,
|
||||
/turf/simulated/floor/tiled/dark,
|
||||
@@ -39507,28 +39532,6 @@
|
||||
/obj/effect/floor_decal/steeldecal/steel_decals4,
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/surface/station/rnd/hallway/stairwell)
|
||||
"rnZ" = (
|
||||
/obj/structure/cable{
|
||||
d1 = 2;
|
||||
d2 = 8;
|
||||
icon_state = "2-8"
|
||||
},
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/supply{
|
||||
dir = 10
|
||||
},
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{
|
||||
dir = 10
|
||||
},
|
||||
/obj/machinery/navbeacon/patrol{
|
||||
location = "SEC";
|
||||
next_patrol = "NH1"
|
||||
},
|
||||
/obj/effect/floor_decal/steeldecal/steel_decals_central2,
|
||||
/obj/effect/floor_decal/steeldecal/steel_decals_central6,
|
||||
/mob/living/bot/secbot/beepsky,
|
||||
/obj/item/radio/beacon,
|
||||
/turf/simulated/floor/tiled/monotile,
|
||||
/area/surface/station/hallway/primary/groundfloor/north)
|
||||
"roh" = (
|
||||
/obj/structure/cable/yellow{
|
||||
d2 = 8;
|
||||
@@ -48371,11 +48374,6 @@
|
||||
/obj/effect/floor_decal/corner/paleblue/border,
|
||||
/turf/simulated/floor/tiled/white,
|
||||
/area/surface/station/medical/storage/primary_storage)
|
||||
"vvm" = (
|
||||
/obj/structure/table/woodentable,
|
||||
/obj/item/dice,
|
||||
/turf/simulated/floor/carpet,
|
||||
/area/surface/station/library)
|
||||
"vvG" = (
|
||||
/obj/machinery/door/firedoor/border_only,
|
||||
/obj/structure/grille,
|
||||
@@ -82586,8 +82584,8 @@ iph
|
||||
lpm
|
||||
oEj
|
||||
vrU
|
||||
bTe
|
||||
gvo
|
||||
aab
|
||||
aae
|
||||
pHY
|
||||
vHV
|
||||
vag
|
||||
@@ -82843,7 +82841,7 @@ tum
|
||||
orw
|
||||
jkH
|
||||
vrU
|
||||
vvm
|
||||
aac
|
||||
nsO
|
||||
pHY
|
||||
vHV
|
||||
@@ -83099,7 +83097,7 @@ ivt
|
||||
wlI
|
||||
aUr
|
||||
lWA
|
||||
qCT
|
||||
aad
|
||||
qwH
|
||||
qwH
|
||||
bUi
|
||||
@@ -84326,7 +84324,7 @@ iaO
|
||||
mjO
|
||||
uBH
|
||||
mtC
|
||||
hEZ
|
||||
qCU
|
||||
aVg
|
||||
dyx
|
||||
sYc
|
||||
@@ -90505,7 +90503,7 @@ wRI
|
||||
nFp
|
||||
nFp
|
||||
igv
|
||||
rnZ
|
||||
aaa
|
||||
cEE
|
||||
fAE
|
||||
gJI
|
||||
|
||||
@@ -1046,6 +1046,7 @@
|
||||
#include "code\game\objects\items\stacks\tiles\tile_types.dm"
|
||||
#include "code\game\objects\items\toys\godfigures.dm"
|
||||
#include "code\game\objects\items\toys\mech_toys.dm"
|
||||
#include "code\game\objects\items\toys\poker_chips.dm"
|
||||
#include "code\game\objects\items\toys\toys.dm"
|
||||
#include "code\game\objects\items\weapons\AI_modules.dm"
|
||||
#include "code\game\objects\items\weapons\augment_items.dm"
|
||||
|
||||
Reference in New Issue
Block a user