Skip to content

Commit

Permalink
World icon 2 (#3516)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
World icon now only require setting the world_file var to work
<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
easier
<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
add: Readdes world icons for a few knives. Expect more soon!
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
FalloutFalcon authored Oct 10, 2024
1 parent b36beab commit 4b09c1e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion code/datums/elements/world_icon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
SIGNAL_HANDLER

if(!world_icon_state)
source.icon_state = source.icon_state
source.icon_state = source.item_state
return

INVOKE_ASYNC(src, PROC_REF(check_world_icon_state), source)
Expand Down
15 changes: 11 additions & 4 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
///Icon file for right inhand overlays
var/righthand_file = 'icons/mob/inhands/items_righthand.dmi'

///If set it will add a world icon using item_state
var/world_file

///Handled by world_icon element
var/world_state
///Handled by world_icon element
var/inventory_state

///This is a bitfield that defines what variations exist for bodyparts like Digi legs.
var/supports_variations = null

Expand Down Expand Up @@ -207,10 +215,6 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb

var/canMouseDown = FALSE

//for setting world icons on the go
var/inventory_state
var/world_state

/obj/item/Initialize()

if(attack_verb)
Expand Down Expand Up @@ -309,6 +313,9 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb

updateEmbedding()

if(world_file)
AddElement(/datum/element/world_icon, null, world_file, icon)

if(GLOB.rpg_loot_items)
AddComponent(/datum/component/fantasy)

Expand Down
3 changes: 3 additions & 0 deletions code/game/objects/items/melee/knife.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
force = 20
throwforce = 20
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "cut")
world_file = 'icons/obj/world/melee.dmi'

/obj/item/melee/knife/survival
name = "survival knife"
Expand All @@ -115,6 +116,7 @@
force = 15
throwforce = 15
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "cut")
world_file = 'icons/obj/world/melee.dmi'

/obj/item/melee/knife/bone
name = "bone dagger"
Expand All @@ -127,6 +129,7 @@
force = 15
throwforce = 15
custom_materials = null
world_file = 'icons/obj/world/melee.dmi'

/obj/item/melee/knife/combat/cyborg
name = "cyborg knife"
Expand Down

0 comments on commit 4b09c1e

Please sign in to comment.