mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-24 05:23:22 +01:00
Contained Sprites v2 (#758)
Overhauls the contained sprites system to be feature complete in terms of what it can do and offers. Now almost all cases of clothing and other items may use the system properly.
This commit is contained in:
@@ -43,10 +43,13 @@
|
||||
var/zoomdevicename = null //name used for message when binoculars/scope is used
|
||||
var/zoom = 0 //1 if item is actively being used to zoom. For scoped guns and binoculars.
|
||||
var/contained_sprite = 0 //1 if item_state, lefthand, righthand, and worn sprite are all in one dmi
|
||||
|
||||
var/item_state = null // Used to specify the item state for the on-mob overlays.
|
||||
|
||||
//Item_state definition moved to /obj
|
||||
//var/item_state = null // Used to specify the item state for the on-mob overlays.
|
||||
var/item_state_slots = null //overrides the default item_state for particular slots.
|
||||
|
||||
|
||||
//ITEM_ICONS ARE DEPRECATED. USE CONTAINED SPRITES IN FUTURE
|
||||
// Used to specify the icon file to be used when the item is worn. If not set the default icon for that slot will be used.
|
||||
// If icon_override or sprite_sheets are set they will take precendence over this, assuming they apply to the slot in question.
|
||||
// Only slot_l_hand/slot_r_hand are implemented at the moment. Others to be implemented as needed.
|
||||
|
||||
@@ -60,9 +60,9 @@
|
||||
user << "The [O] is empty."
|
||||
else if(O.reagents.total_volume >= 1)
|
||||
if(O.reagents.has_reagent("pacid", 1))
|
||||
user << "The acid chews through the balloon!"
|
||||
user << "The acid chews through the balloon!"
|
||||
O.reagents.splash(user, reagents.total_volume)
|
||||
qdel(src)
|
||||
qdel(src)
|
||||
else
|
||||
src.desc = "A translucent balloon with some form of liquid sloshing around in it."
|
||||
user << "\blue You fill the balloon with the contents of [O]."
|
||||
@@ -142,7 +142,7 @@
|
||||
icon = 'icons/obj/gun.dmi'
|
||||
icon_state = "revolver"
|
||||
item_state = "revolver"
|
||||
item_icons = list(
|
||||
item_icons = list(//ITEM_ICONS ARE DEPRECATED. USE CONTAINED SPRITES IN FUTURE
|
||||
icon_l_hand = 'icons/mob/items/lefthand_guns.dmi',
|
||||
icon_r_hand = 'icons/mob/items/righthand_guns.dmi',
|
||||
)
|
||||
@@ -224,7 +224,7 @@
|
||||
icon = 'icons/obj/gun.dmi'
|
||||
icon_state = "crossbow"
|
||||
item_state = "crossbow"
|
||||
item_icons = list(
|
||||
item_icons = list(//ITEM_ICONS ARE DEPRECATED. USE CONTAINED SPRITES IN FUTURE
|
||||
icon_l_hand = 'icons/mob/items/lefthand_guns.dmi',
|
||||
icon_r_hand = 'icons/mob/items/righthand_guns.dmi',
|
||||
)
|
||||
|
||||
@@ -76,7 +76,8 @@
|
||||
feedback_add_details("handcuffs","H")
|
||||
|
||||
user.visible_message("<span class='danger'>\The [user] has put [cuff_type] on \the [H]!</span>")
|
||||
|
||||
target.drop_r_hand()
|
||||
target.drop_l_hand()
|
||||
// Apply cuffs.
|
||||
var/obj/item/weapon/handcuffs/cuffs = src
|
||||
if(dispenser)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/obj/item/weapon/storage/backpack
|
||||
name = "backpack"
|
||||
desc = "You wear this on your back and put items into it."
|
||||
item_icons = list(
|
||||
item_icons = list(//ITEM_ICONS ARE DEPRECATED. USE CONTAINED SPRITES IN FUTURE
|
||||
slot_l_hand_str = 'icons/mob/items/lefthand_backpacks.dmi',
|
||||
slot_r_hand_str = 'icons/mob/items/righthand_backpacks.dmi',
|
||||
)
|
||||
|
||||
@@ -126,15 +126,24 @@
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Welding Tool
|
||||
*/
|
||||
/obj/item/weapon/weldingtool
|
||||
name = "welding tool"
|
||||
icon = 'icons/obj/items.dmi'
|
||||
desc = "A welding tool with a built-in fuel tank, designed for welding and cutting metal."
|
||||
icon = 'icons/obj/tools/welding.dmi'
|
||||
icon_state = "welder"
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BELT
|
||||
var/base_iconstate = "welder"//These are given an _on/_off suffix before being used
|
||||
var/base_itemstate = "welder"
|
||||
contained_sprite = 1
|
||||
|
||||
//Amount of OUCH when it's thrown
|
||||
force = 3.0
|
||||
@@ -154,14 +163,69 @@
|
||||
var/status = 1 //Whether the welder is secured or unsecured (able to attach rods to it to make a flamethrower)
|
||||
var/max_fuel = 20 //The max amount of fuel the welder can hold
|
||||
|
||||
|
||||
/obj/item/weapon/weldingtool/largetank
|
||||
name = "industrial welding tool"
|
||||
desc = "A welding tool with an extended-capacity built-in fuel tank, standard issue for engineers."
|
||||
max_fuel = 40
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 100, "glass" = 60)
|
||||
origin_tech = "engineering=2"
|
||||
base_iconstate = "ind_welder"
|
||||
|
||||
|
||||
/obj/item/weapon/weldingtool/hugetank
|
||||
name = "advanced welding tool"
|
||||
desc = "A rare and powerful welding tool with a super-extended fuel tank."
|
||||
max_fuel = 80
|
||||
w_class = 2.0
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 200, "glass" = 120)
|
||||
origin_tech = "engineering=3"
|
||||
base_iconstate = "adv_welder"
|
||||
|
||||
|
||||
//The Experimental Welding Tool!
|
||||
/obj/item/weapon/weldingtool/experimental
|
||||
name = "experimental welding tool"
|
||||
desc = "A scientifically-enhanced welding tool that uses fuel-producing microbes to gradually replenish its fuel supply"
|
||||
max_fuel = 40
|
||||
w_class = 2.0
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 100, "glass" = 120)
|
||||
origin_tech = "engineering=4;biotech=4"
|
||||
base_iconstate = "exp_welder"
|
||||
base_itemstate = "exp_welder"
|
||||
|
||||
var/last_gen = 0
|
||||
var/fuelgen_delay = 800//The time, in deciseconds, required to regenerate one unit of fuel
|
||||
//800 = 1 unit per 1 minute and 20 seconds,
|
||||
//This is roughly half the rate that fuel is lost if the welder is left idle, so it you carelessly leave it on it will still run out
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//Welding tool functionality here
|
||||
/obj/item/weapon/weldingtool/New()
|
||||
// var/random_fuel = min(rand(10,20),max_fuel)
|
||||
var/datum/reagents/R = new/datum/reagents(max_fuel)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
R.add_reagent("fuel", max_fuel)
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/item/weapon/weldingtool/update_icon()
|
||||
..()
|
||||
var/add = welding ? "_on" : "_off"
|
||||
icon_state = base_iconstate + add //These are given an _on/_off suffix before being used
|
||||
item_state = base_itemstate + add
|
||||
var/mob/M = loc
|
||||
if(istype(M))
|
||||
M.update_inv_l_hand()
|
||||
M.update_inv_r_hand()
|
||||
|
||||
/obj/item/weapon/weldingtool/Destroy()
|
||||
if(welding)
|
||||
processing_objects -= src
|
||||
@@ -228,6 +292,33 @@
|
||||
if (istype(location, /turf))
|
||||
location.hotspot_expose(700, 5)
|
||||
|
||||
/obj/item/weapon/weldingtool/attack(mob/M as mob, mob/user as mob)
|
||||
|
||||
if(hasorgans(M))
|
||||
|
||||
var/obj/item/organ/external/S = M:organs_by_name[user.zone_sel.selecting]
|
||||
|
||||
if (!S) return
|
||||
if(!(S.status & ORGAN_ROBOT) || user.a_intent != I_HELP)
|
||||
return ..()
|
||||
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species.flags & IS_SYNTHETIC)
|
||||
if(M == user)
|
||||
user << "\red You can't repair damage to your own body - it's against OH&S."
|
||||
return
|
||||
|
||||
if(S.brute_dam)
|
||||
S.heal_damage(15,0,0,1)
|
||||
user.visible_message("\red \The [user] patches some dents on \the [M]'s [S.name] with \the [src].")
|
||||
return
|
||||
else
|
||||
user << "Nothing to fix!"
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob, proximity)
|
||||
if(!proximity) return
|
||||
@@ -298,13 +389,7 @@
|
||||
/obj/item/weapon/weldingtool/proc/isOn()
|
||||
return src.welding
|
||||
|
||||
/obj/item/weapon/weldingtool/update_icon()
|
||||
..()
|
||||
icon_state = welding ? "welder1" : "welder"
|
||||
var/mob/M = loc
|
||||
if(istype(M))
|
||||
M.update_inv_l_hand()
|
||||
M.update_inv_r_hand()
|
||||
|
||||
|
||||
//Sets the welding state of the welding tool. If you see W.welding = 1 anywhere, please change it to W.setWelding(1)
|
||||
//so that the welding tool updates accordingly
|
||||
@@ -396,34 +481,7 @@
|
||||
return
|
||||
|
||||
|
||||
/obj/item/weapon/weldingtool/largetank
|
||||
name = "industrial welding tool"
|
||||
max_fuel = 40
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 60)
|
||||
origin_tech = "engineering=2"
|
||||
|
||||
/obj/item/weapon/weldingtool/hugetank
|
||||
name = "upgraded welding tool"
|
||||
max_fuel = 80
|
||||
w_class = 2.0
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 120)
|
||||
origin_tech = "engineering=3"
|
||||
|
||||
|
||||
|
||||
|
||||
//The Experimental Welding Tool!
|
||||
/obj/item/weapon/weldingtool/experimental
|
||||
name = "experimental welding tool"
|
||||
desc = "A scientifically-enhanced welding tool that uses fuel-producing microbes to gradually replenish its fuel supply"
|
||||
max_fuel = 40
|
||||
w_class = 2.0
|
||||
matter = list(DEFAULT_WALL_MATERIAL = 70, "glass" = 120)
|
||||
origin_tech = "engineering=4;biotech=4"
|
||||
var/last_gen = 0
|
||||
var/fuelgen_delay = 800//The time, in deciseconds, required to regenerate one unit of fuel
|
||||
//800 = 1 unit per 1 minute and 20 seconds,
|
||||
//This is roughly half the rate that fuel is lost if the welder is left idle, so it you carelessly leave it on it will still run out
|
||||
|
||||
/obj/item/weapon/weldingtool/Destroy()
|
||||
processing_objects.Remove(src)//Stop processing when destroyed regardless of conditions
|
||||
@@ -486,32 +544,7 @@
|
||||
icon_state = "red_crowbar"
|
||||
item_state = "crowbar_red"
|
||||
|
||||
/obj/item/weapon/weldingtool/attack(mob/M as mob, mob/user as mob)
|
||||
|
||||
if(hasorgans(M))
|
||||
|
||||
var/obj/item/organ/external/S = M:organs_by_name[user.zone_sel.selecting]
|
||||
|
||||
if (!S) return
|
||||
if(!(S.status & ORGAN_ROBOT) || user.a_intent != I_HELP)
|
||||
return ..()
|
||||
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species.flags & IS_SYNTHETIC)
|
||||
if(M == user)
|
||||
user << "\red You can't repair damage to your own body - it's against OH&S."
|
||||
return
|
||||
|
||||
if(S.brute_dam)
|
||||
S.heal_damage(15,0,0,1)
|
||||
user.visible_message("\red \The [user] patches some dents on \the [M]'s [S.name] with \the [src].")
|
||||
return
|
||||
else
|
||||
user << "Nothing to fix!"
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
/*/obj/item/weapon/combitool
|
||||
name = "combi-tool"
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
|
||||
var/being_shocked = 0
|
||||
|
||||
var/item_state // Base name of the image used for when the item is worn. Suffixes are added to this.
|
||||
var/icon_species_tag = ""//If set, this holds the 3-letter shortname of a species, used for species-specific worn icons
|
||||
var/icon_auto_adapt = 0//If 1, this item will automatically change its species tag to match the wearer's species.
|
||||
//requires that the wearer's species is listed in icon_supported_species_tags
|
||||
var/list/icon_supported_species_tags //Used with icon_auto_adapt, a list of species which have differing appearances for this item
|
||||
var/icon_species_in_hand = 0//If 1, we will use the species tag even for rendering this item in the left/right hand.
|
||||
|
||||
/obj/Destroy()
|
||||
processing_objects -= src
|
||||
nanomanager.close_uis(src)
|
||||
@@ -167,3 +174,13 @@
|
||||
if(src)
|
||||
step(src, pick(NORTH,SOUTH,EAST,WEST))
|
||||
sleep(rand(2,4))
|
||||
|
||||
|
||||
/obj/proc/auto_adapt_species(var/mob/living/carbon/human/wearer)
|
||||
if(icon_auto_adapt)
|
||||
icon_species_tag = ""
|
||||
if (loc == wearer && icon_supported_species_tags.len)
|
||||
if (wearer.species.short_name in icon_supported_species_tags)
|
||||
icon_species_tag = wearer.species.short_name
|
||||
return 1
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user