Files
Bubberstation/code/modules/art/statues.dm
LemonInTheDark 4b4e9dff1d Wallening [IDB IGNORE] [MDB IGNORE] (#85491)
## What's going on here

Kept you waitin huh!

This pr resprites most all walls, windows and other "wall adjacent"
things to a 3/4th perspective, technical term is "tall" walls (we are
very smart).

If you're trying to understand the technical details here, much of the
"rendering tech" is built off the idea of split-vis. Basically, split a
sprite up and render it on adjacent turfs, to prevent seeing "through"
walls/doors, and to support seeing "edges" without actually seeing the
atom itself.

Most of the rest of it is pipelining done to accommodate how icons are
cut.

## Path To Merge

Almost* all sprites and code is done at this point. 
There are some things missing both on and off the bounty list, but that
will be the case forever unless we force upstream (you guys) to stop
adding new shit that doesn't fit the style.
I plan on accepting and integrating prs to the current working repo
<https://github.com/wall-nerds/wallening> up until a merge, to make
contribution simpler and allow things like bounties to close out more
easily

This pr is quite bulky, even stripping away map changes it's maybe 7000
LOC (We have a few maps that were modified with UpdatePaths, I am also
tentatively pring our test map, for future use.)
This may inhibit proper review, although that is part of why I am
willing to make it despite my perfectionism. Apologies in advance.

Due to the perspective shift, a lot of mapping work is going to need to
be done at some point. This comes in varying levels of priority. Many
wallmounts are offset by hand, some are stuck in the wall/basically
cannot be placed on the east/west/north edges of walls (posters), some
just don't look great good in their current position.

Tests are currently a minor bit yorked, I thought it was more important
to get this up then to clean them fully.

## What does it look like?


![dreamseeker_hBsU6wCu91](https://github.com/user-attachments/assets/5392fa3b-60f6-40ea-876f-e686f25f996a)

![dreamseeker_CTiK0Je5iR](https://github.com/user-attachments/assets/1aee23bd-a5ec-4679-b094-d044401b7222)

![dreamseeker_HYkS1Q9GRq](https://github.com/user-attachments/assets/bad8844b-3179-4856-8684-f912e14e844a)

![dreamseeker_Pa18tgyKYp](https://github.com/user-attachments/assets/c2e1d222-9e5c-4500-8829-dd065428644a)

![dreamseeker_BfOBwS2mjH](https://github.com/user-attachments/assets/7dc51153-111d-4b17-93c3-8389daa6b60b)

![dreamseeker_iJazOumiMQ](https://github.com/user-attachments/assets/5837e203-3865-4f60-854e-62b4875c6b99)

## Credits

<details>
<summary>Historical Mumbojumbo</summary>

I am gonna do my best to document how this project came to be. I am
operating off third party info and half remembered details, so if I'm
wrong please yell at me.

This project started sometime in late 2020, as a product of Rohesie
trying to integrate and make easier work from Mojave Sun (A recently
defunct fallout server) with /tg/.

Mojave Sun (Apparently this was LITERALLY JUST infrared baron, that man
is insane) was working with tall walls, IE walls that are 48px tall
instead of the normal 32. This was I THINK done based off a technical
prototype from aao7 proving A it was possible and B it didn't look like
dogwater.

This alongside oranges begging the art team for 3/4th walls (he meant
TGMC style) lead to Rohesie bringing on contributors from general /tg/,
including actionninja who would eventually take over as technical lead
and Kryson, who would define /tg/'s version of the artstyle. Much of the
formative aspects of this project are their work.

The project was coming along pretty well for a few months, but ran into
serious technical issues with `SIDE_MAP`, a byond map_format that allows
for simpler 3/4th rendering.
Due to BULLSHIT I will not detail here, the map format caused issues
both at random with flickering and heavily with multiz.

Concurrent with this, action stepped down after hacking out the
rendering tech and starting work on an icon cutter that would allow for
simpler icon generation, leaving ninjanomnom to manage the project.

Some time passed, and the project stalled out due to the technical
issues. Eventually I built a test case for the issues we had with
`SIDE_MAP` and convinced lummox jr (byond's developer) to explain how
the fuckin thing actually worked. This understanding made the project
theoretically possible, but did not resolve the problems with multi-z.
Resolving those required a full rework of how rendering like, worked. I
(alongside tattle) took over project development from ninjanomnom at
this time, and started work on Plane Cube (#69115), which when finished
would finally make the project technically feasible.

The time between then and now has been slow, progressive work. Many many
artists and technical folks have dumped their time into this (as you can
see from the credits). I will get into this more below but I would like
to explicitly thank (in no particular order) tattle, draco, arcanemusic,
actionninja, imaginos, viro and kylerace for keeping the project alive
in this time period. I would have curled up into a ball and died if I
had to do this all myself, your help has been indispensable.

</details>

<details>
<summary>Detailed Credits</summary>

Deep apologies if I have forgotten someone (I am sure I have, if someone
is you please contact me). I've done my best to collate from the git
log/my memory.

Thanks to (In no particular order):
Raccoff: Being funny to bully, creating threshold decals for airlocks
aa07: (I think) inspiring the project
ActionNinja: Laying the technical rock we build off, supporting me
despite byond trying to kill him, building the icon cutter that makes
this possible
ArcaneMusic: Artistic and technical work spanning from the project's
start to literally today, being a constant of motivation and positivity.
I can't list all the stuff he's done
Armhulen: Key rendering work (he's the reason thindows render right), an
upbeat personality and a kick in the ass. Love you arm
Azlan: Damn cool sprites, consistently
Ben10Omintrix: You know ben showed up just to make basic mobs work, he's
just fuckin like that man
BigBimmer: A large amount of bounty work, alongside just like, throwing
shit around. An absolute joy to work with
Capsandi: Plaques, blastdoors, artistic work early on
CapybaraExtravagante: Rendering work on wall frames
Draco: SO MUCH STUFF. Much of the spritework done over the past two
years is his, constantly engaged and will take on anything. I would have
given up if not for you
Floyd: Early rendering work, so early I don't even know the details.
Enjoy freedom brother
Imaginos16: A guiding hand through the middle years, handled much of the
sprite review and contribution for a good bit there
Iamgoofball: A dedication to detail and aesthetic goals, spends a lot of
effort dissecting feedback with a focus on making things as good as they
can be at the jump
Infrared: Part of the impetus for the project, made all the xenomorph
stuff in the MS style
Jacquerel: A bunch of little upkeep/technical things, has done so much
sprite gruntwork (WHY ARE THERE SO MANY PAINTING TYPES)
Justice12354: Solved a bunch of error sprites (and worked out how to
actually make prs to the project) Thanks bro!
Kryson: Built the artstyle of the project, carrying on for years even
when it was technically dying, only stopping to casually beat cancer. So
much of our style and art is Kryson
KylerAce: Handled annoying technical stuff for me, built window frame
logic and fully got rid of grilles.
LemonInTheDark: Rendering dirtywork, project management and just so much
fucking time in dreammaker editing sprites
Meyhazah: Table buttons, brass windows and alll the old style doors
Mothblocks: Has provided constant support, gave me a deadline and
motivation, erased worries about "it not being done", gave just SO much
money to fill in the critical holes in sprites. Thanks moth
MTandi: Contributed art despite his own blackjack and hookers club
opening right down the road, I'm sorry I rolled over some of your
sprites man I wish we had finished earlier
Ninjanomnomnom: Consulted on gags issues, kept things alive through some
truly shit times
oranges: This is his fault
Rohesie: Organized the effort, did much of the initial like, proof of
concept stuff. I hope you're doin well whatever you're up to.
san7890: Consulting on mapper UX/design problems, being my pet mapper
Senefi: Offsetting items with a focus on detail/the more unused
canidates
SimplyLogan: Detailed map work and mapper feedback, personally very kind
even if we end up talking past each other sometimes. Thank you!
SpaceSmithers: Just like, random mapping support out of nowhere, and
bein a straight up cool dude
Tattle: A bunch of misc project management stuff, organizing the
discord, managing the test server, dealing with all the mapping bullshit
for me, being my backup in case of bus. I know you think you didn't do
much but your presence and work have been a great help
Thunder12345: Came out of nowhere and just so much of the random
bounties, I'm kind of upset about how much we paid him
Time-Green: I hooked him in by fucking with stuff he made and now he's
just doin shit, thanks for helping out man!
Twaticus: Provided artistic feedback and authority for my poor feeble
coder brain, believed in the project for YEARS, was a constant source of
❤️ and affirmation
unit0016: I have no god damn idea who she is, popped out of nowhere on
the github one day and dealt with a bunch of annoying
rendering/refactoring. Godspeed random furry thank you for all your
effort and issue reports
Viro: A bunch of detailed spriting moving towards 3/4ths, both on and
off the wallening fork. If anyone believed this project would be done,
it was viro
Wallem: Artistic review and consultation, was my go-to guy for a long
time when the other two spritetainers were inactive
Waltermeldon: Cracked out a bunch of rendering work, he's the reason
windows look like not dogwater. Alongside floyd and action spent a TON
of time speaking to lummox/unearthing how byond rendering worked trying
to make this thing happen
ZephyrTFA: Added directional airlock helpers, dealt with a big fuckin
bugaboo that was living in my brain like it was nothing. Love you
brother

And finally:
The Mojave Sun development team. They provided a testbed for the idea,
committed hundreds and hundreds of hours to the artstyle, and were a
large reason we caught issues early enough to meaningfully deal with
them. Your work is a testament to what longterm effort and deep detailed
care produce. I hope you're doing well whatever you're up to. Go out
with a bang!
</details>

## Changelog
🆑 Raccoff, aa07, ActionNinja, ArcaneMusic, Armhulen, Azlan,
Ben10Omintrix, BigBimmer, Capsandi, CapybaraExtravagante, Draco, Floyd,
Iamgoofball, Imaginos16, Infrared, Jacquerel, Justice12354, Kryson,
KylerAce, LemonInTheDark, Meyhazah, Mothblocks, MTandi, Ninjanomnom,
oranges, Rohesie, Runi-c, san7890, Senefi, SimplyLogan, SomeAngryMiner,
SpaceSmithers, Tattle, Thunder12345, Time-Green, Twaticus, unit0016,
Viro, Waltermeldon, ZephyrTFA with thanks to the Mojave Sun team!
add: Resprites or offsets almost all "tall" objects in the game to match
a 3/4ths perspective
add: Bunch of rendering mumbo jumbo to make said 3/4ths perspective work
/🆑

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: san7890 <the@san7890.com>
Co-authored-by: = <stewartareid@outlook.com>
Co-authored-by: Capsandi <dansullycc@gmail.com>
Co-authored-by: ArcaneMusic <hero12290@aol.com>
Co-authored-by: tattle <66640614+dragomagol@users.noreply.github.com>
Co-authored-by: SomeAngryMiner <53237389+SomeAngryMiner@users.noreply.github.com>
Co-authored-by: KylerAce <kylerlumpkin1@gmail.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
Co-authored-by: lessthanthree <83487515+lessthnthree@users.noreply.github.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: Runi-c <5150427+Runi-c@users.noreply.github.com>
Co-authored-by: Roryl-c <5150427+Roryl-c@users.noreply.github.com>
Co-authored-by: tattle <article.disaster@gmail.com>
Co-authored-by: Senefi <20830349+Peliex@users.noreply.github.com>
Co-authored-by: Justice <42555530+Justice12354@users.noreply.github.com>
Co-authored-by: BluBerry016 <50649185+unit0016@users.noreply.github.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Co-authored-by: Emmett Gaines <ninjanomnom@gmail.com>
Co-authored-by: Rob Bailey <github@criticalaction.net>
Co-authored-by: MMMiracles <lolaccount1@hotmail.com>
2024-08-14 09:07:45 +00:00

612 lines
22 KiB
Plaintext

/// This controls the delay for the sculpt rock breaking sound
/// Every 4th iterator while sculpting will emit a sound (rougly every couple of seconds)
#define SCULPT_SOUND_INCREMENT 4
/obj/structure/statue
SET_BASE_VISUAL_PIXEL(0, DEPTH_OFFSET)
name = "statue"
desc = "Placeholder. Yell at Firecage if you SOMEHOW see this."
icon = 'icons/obj/art/statue.dmi'
icon_state = ""
density = TRUE
anchored = FALSE
max_integrity = 100
can_atmos_pass = ATMOS_PASS_DENSITY
material_modifier = 0.5
material_flags = MATERIAL_EFFECTS | MATERIAL_AFFECT_STATISTICS
blocks_emissive = EMISSIVE_BLOCK_UNIQUE
/// Beauty component mood modifier
var/impressiveness = 15
/// Art component subtype added to this statue
var/art_type = /datum/element/art
/// Abstract root type
var/abstract_type = /obj/structure/statue
/obj/structure/statue/Initialize(mapload)
. = ..()
AddElement(art_type, impressiveness)
AddElement(/datum/element/beauty, impressiveness * 75)
AddComponent(/datum/component/simple_rotation)
AddComponent(/datum/component/marionette)
/obj/structure/statue/wrench_act(mob/living/user, obj/item/tool)
. = ..()
default_unfasten_wrench(user, tool)
return ITEM_INTERACT_SUCCESS
/obj/structure/statue/attackby(obj/item/W, mob/living/user, params)
add_fingerprint(user)
if(W.tool_behaviour == TOOL_WELDER)
if(!W.tool_start_check(user, amount=1))
return FALSE
user.balloon_alert(user, "slicing apart...")
if(W.use_tool(src, user, 40, volume=50))
deconstruct(TRUE)
return
return ..()
/obj/structure/statue/atom_deconstruct(disassembled = TRUE)
var/amount_mod = disassembled ? 0 : -2
for(var/mat in custom_materials)
var/datum/material/custom_material = GET_MATERIAL_REF(mat)
var/amount = max(0,round(custom_materials[mat]/SHEET_MATERIAL_AMOUNT) + amount_mod)
if(amount > 0)
new custom_material.sheet_type(drop_location(), amount)
//////////////////////////////////////STATUES/////////////////////////////////////////////////////////////
////////////////////////uranium///////////////////////////////////
/obj/structure/statue/uranium
max_integrity = 300
// largish, dim green glow
light_range = 3
light_power = 0.7
light_color = LIGHT_COLOR_NUCLEAR
custom_materials = list(/datum/material/uranium=SHEET_MATERIAL_AMOUNT*5)
impressiveness = 25 // radiation makes an impression
abstract_type = /obj/structure/statue/uranium
/obj/structure/statue/uranium/nuke
name = "statue of a nuclear fission explosive"
desc = "This is a grand statue of a Nuclear Explosive. It has a sickening green colour."
icon_state = "nuke"
/obj/structure/statue/uranium/eng
name = "Statue of an engineer"
desc = "This statue has a sickening green colour."
icon_state = "eng"
////////////////////////////plasma///////////////////////////////////////////////////////////////////////
/obj/structure/statue/plasma
max_integrity = 200
impressiveness = 20
desc = "This statue is suitably made from plasma."
custom_materials = list(/datum/material/plasma=SHEET_MATERIAL_AMOUNT*5)
abstract_type = /obj/structure/statue/plasma
/obj/structure/statue/plasma/scientist
name = "statue of a scientist"
icon_state = "sci"
/obj/structure/statue/plasma/xeno
name = "statue of a xenomorph"
icon_state = "xeno"
//////////////////////gold///////////////////////////////////////
/obj/structure/statue/gold
max_integrity = 300
impressiveness = 25
desc = "This is a highly valuable statue made from gold."
custom_materials = list(/datum/material/gold=SHEET_MATERIAL_AMOUNT*5)
abstract_type = /obj/structure/statue/gold
/obj/structure/statue/gold/hos
name = "statue of the head of security"
icon_state = "hos"
/obj/structure/statue/gold/hop
name = "statue of the head of personnel"
icon_state = "hop"
/obj/structure/statue/gold/cmo
name = "statue of the chief medical officer"
icon_state = "cmo"
/obj/structure/statue/gold/ce
name = "statue of the chief engineer"
icon_state = "ce"
/obj/structure/statue/gold/rd
name = "statue of the research director"
icon_state = "rd"
/obj/structure/statue/gold/qm
name = "statue of the quartermaster"
icon_state = "qm"
//////////////////////////silver///////////////////////////////////////
/obj/structure/statue/silver
max_integrity = 300
impressiveness = 25
desc = "This is a valuable statue made from silver."
custom_materials = list(/datum/material/silver=SHEET_MATERIAL_AMOUNT*5)
abstract_type = /obj/structure/statue/silver
/obj/structure/statue/silver/md
name = "statue of a medical officer"
icon_state = "md"
/obj/structure/statue/silver/janitor
name = "statue of a janitor"
icon_state = "jani"
/obj/structure/statue/silver/sec
name = "statue of a security officer"
icon_state = "sec"
/obj/structure/statue/silver/secborg
name = "statue of a security cyborg"
icon_state = "secborg"
/obj/structure/statue/silver/medborg
name = "statue of a medical cyborg"
icon_state = "medborg"
/////////////////////////diamond/////////////////////////////////////////
/obj/structure/statue/diamond
max_integrity = 1000
impressiveness = 50
desc = "This is a very expensive diamond statue."
custom_materials = list(/datum/material/diamond=SHEET_MATERIAL_AMOUNT*5)
abstract_type = /obj/structure/statue/diamond
/obj/structure/statue/diamond/captain
name = "statue of THE captain."
icon_state = "cap"
/obj/structure/statue/diamond/ai1
name = "statue of the AI hologram."
icon_state = "ai1"
/obj/structure/statue/diamond/ai2
name = "statue of the AI core."
icon_state = "ai2"
////////////////////////bananium///////////////////////////////////////
/obj/structure/statue/bananium
max_integrity = 300
impressiveness = 50
desc = "A bananium statue with a small engraving:'HOOOOOOONK'."
custom_materials = list(/datum/material/bananium=SHEET_MATERIAL_AMOUNT*5)
abstract_type = /obj/structure/statue/bananium
/obj/structure/statue/bananium/clown
name = "statue of a clown"
icon_state = "clown"
/////////////////////sandstone/////////////////////////////////////////
/obj/structure/statue/sandstone
max_integrity = 50
impressiveness = 15
custom_materials = list(/datum/material/sandstone=SHEET_MATERIAL_AMOUNT*5)
abstract_type = /obj/structure/statue/sandstone
/obj/structure/statue/sandstone/assistant
name = "statue of an assistant"
desc = "A cheap statue of sandstone for a greyshirt."
icon_state = "assist"
/obj/structure/statue/sandstone/venus //call me when we add marble i guess
name = "statue of a pure maiden"
desc = "An ancient marble statue. The subject is depicted with a floor-length braid and is wielding a toolbox. By Jove, it's easily the most gorgeous depiction of a woman you've ever seen. The artist must truly be a master of his craft. Shame about the broken arm, though."
icon = 'icons/obj/art/statuelarge.dmi'
icon_state = "venus"
/////////////////////snow/////////////////////////////////////////
/obj/structure/statue/snow
max_integrity = 50
custom_materials = list(/datum/material/snow=SHEET_MATERIAL_AMOUNT*5)
abstract_type = /obj/structure/statue/snow
/obj/structure/statue/snow/snowman
name = "snowman"
desc = "Several lumps of snow put together to form a snowman."
icon_state = "snowman"
/obj/structure/statue/snow/snowlegion
name = "snowlegion"
desc = "Looks like that weird kid with the tiger plushie has been round here again."
icon_state = "snowlegion"
///////////////////////////////bronze///////////////////////////////////
/obj/structure/statue/bronze
custom_materials = list(/datum/material/bronze=SHEET_MATERIAL_AMOUNT*5)
abstract_type = /obj/structure/statue/bronze
/obj/structure/statue/bronze/marx
name = "\improper Karl Marx bust"
desc = "A bust depicting a certain 19th century economist. You get the feeling a specter is haunting the station."
icon_state = "marx"
art_type = /datum/element/art/rev
///////////Elder Atmosian///////////////////////////////////////////
/obj/structure/statue/elder_atmosian
name = "Elder Atmosian"
desc = "A statue of an Elder Atmosian, capable of bending the laws of thermodynamics to their will."
icon_state = "eng"
custom_materials = list(/datum/material/metalhydrogen = SHEET_MATERIAL_AMOUNT*10)
max_integrity = 1000
impressiveness = 100
abstract_type = /obj/structure/statue/elder_atmosian //This one is uncarvable
///////////Goliath//////////////////////////////////////////////////
/obj/structure/statue/goliath
desc = "A lifelike statue of a horrifying monster."
icon = 'icons/mob/simple/lavaland/lavaland_monsters_wide.dmi'
icon_state = "goliath"
pixel_x = -12
base_pixel_x = -12
name = "goliath"
///////////Other Stuff//////////////////////////////////////////////
/obj/item/chisel
name = "chisel"
desc = "Breaking and making art since 4000 BC. This one uses advanced technology to allow the creation of lifelike moving statues."
icon = 'icons/obj/art/statue.dmi'
icon_state = "chisel"
inhand_icon_state = "screwdriver_nuke"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
obj_flags = CONDUCTS_ELECTRICITY
slot_flags = ITEM_SLOT_BELT
force = 5
w_class = WEIGHT_CLASS_TINY
throwforce = 5
throw_speed = 3
throw_range = 5
custom_materials = list(/datum/material/iron=SMALL_MATERIAL_AMOUNT*0.75)
attack_verb_continuous = list("stabs")
attack_verb_simple = list("stab")
hitsound = 'sound/weapons/bladeslice.ogg'
usesound = list('sound/effects/picaxe1.ogg', 'sound/effects/picaxe2.ogg', 'sound/effects/picaxe3.ogg')
drop_sound = 'sound/items/handling/screwdriver_drop.ogg'
pickup_sound = 'sound/items/handling/screwdriver_pickup.ogg'
sharpness = SHARP_POINTY
tool_behaviour = TOOL_RUSTSCRAPER
toolspeed = 3 // You're gonna have a bad time
/// Block we're currently carving in
var/obj/structure/carving_block/prepared_block
/// If tracked user moves we stop sculpting
var/mob/living/tracked_user
/// Currently sculpting
var/sculpting = FALSE
/obj/item/chisel/Initialize(mapload)
. = ..()
AddElement(/datum/element/eyestab)
AddElement(/datum/element/wall_engraver)
//deals 200 damage to statues, meaning you can actually kill one in ~250 hits
AddElement(/datum/element/bane, target_type = /mob/living/basic/statue, damage_multiplier = 40)
/obj/item/chisel/Destroy()
prepared_block = null
tracked_user = null
return ..()
/*
Hit the block to start
Point with the chisel at the target to choose what to sculpt or hit block to choose from preset statue types.
Hit block again to start sculpting.
Moving interrupts
*/
/obj/item/chisel/interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
if(sculpting)
return ITEM_INTERACT_BLOCKING
if(istype(interacting_with, /obj/structure/carving_block))
var/obj/structure/carving_block/sculpt_block = interacting_with
if(sculpt_block.completion) // someone already started sculpting this so just finish
set_block(sculpt_block, user, silent = TRUE)
start_sculpting(user)
else if(sculpt_block == prepared_block && (prepared_block.current_target || prepared_block.current_preset_type))
start_sculpting(user)
else if(!prepared_block)
set_block(sculpt_block, user)
else if(sculpt_block == prepared_block)
show_generic_statues_prompt(user)
return ITEM_INTERACT_SUCCESS
else if(prepared_block) //We're aiming at something next to us with block prepared
prepared_block.set_target(interacting_with, user)
return ITEM_INTERACT_SUCCESS
return NONE
// We aim at something distant.
/obj/item/chisel/ranged_interact_with_atom(atom/interacting_with, mob/living/user, list/modifiers)
if (!sculpting && prepared_block && ismovable(interacting_with) && prepared_block.completion == 0)
prepared_block.set_target(interacting_with, user)
return ITEM_INTERACT_SUCCESS
return ITEM_INTERACT_BLOCKING
/// Starts or continues the sculpting action on the carving block material
/obj/item/chisel/proc/start_sculpting(mob/living/user)
user.balloon_alert(user, "sculpting block...")
playsound(src, pick(usesound), 75, TRUE)
sculpting = TRUE
//How long whole process takes
var/sculpting_time = 30 SECONDS
//Single interruptible progress period
var/sculpting_period = round(sculpting_time / world.icon_size) //this is just so it reveals pixels line by line for each.
var/interrupted = FALSE
var/remaining_time = sculpting_time - (prepared_block.completion * sculpting_time)
var/datum/progressbar/total_progress_bar = new(user, sculpting_time, prepared_block)
while(remaining_time > 0 && !interrupted)
if(do_after(user, sculpting_period, target = prepared_block, progress = FALSE))
var/time_delay = !(remaining_time % SCULPT_SOUND_INCREMENT)
if(time_delay)
playsound(src, 'sound/effects/break_stone.ogg', 50, TRUE)
remaining_time -= sculpting_period
prepared_block.set_completion((sculpting_time - remaining_time)/sculpting_time)
total_progress_bar.update(sculpting_time - remaining_time)
else
interrupted = TRUE
total_progress_bar.end_progress()
if(!interrupted && !QDELETED(prepared_block))
prepared_block.create_statue()
user.balloon_alert(user, "statue finished")
stop_sculpting(silent = !interrupted)
/// To setup the sculpting target for the carving block
/obj/item/chisel/proc/set_block(obj/structure/carving_block/B, mob/living/user, silent = FALSE)
prepared_block = B
tracked_user = user
RegisterSignal(tracked_user, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved))
if(!silent)
user.balloon_alert(user, "select sculpt target")
/obj/item/chisel/dropped(mob/user, silent)
. = ..()
stop_sculpting()
/// Cancel the sculpting action
/obj/item/chisel/proc/stop_sculpting(silent = FALSE)
sculpting = FALSE
if(prepared_block && prepared_block.completion == 0)
prepared_block.reset_target()
prepared_block = null
if(!silent && tracked_user)
tracked_user.balloon_alert(tracked_user, "sculpting cancelled!")
if(tracked_user)
UnregisterSignal(tracked_user, COMSIG_MOVABLE_MOVED)
tracked_user = null
/obj/item/chisel/proc/on_moved()
SIGNAL_HANDLER
stop_sculpting()
/obj/item/chisel/proc/show_generic_statues_prompt(mob/living/user)
var/list/choices = list()
for(var/statue_path in prepared_block.get_possible_statues())
var/obj/structure/statue/abstract_statue = statue_path
choices[statue_path] = image(icon = initial(abstract_statue.icon), icon_state = initial(abstract_statue.icon_state))
if(!choices.len)
user.balloon_alert(user, "no abstract statues for material!")
var/choice = show_radial_menu(user, prepared_block, choices, require_near = TRUE)
if(choice)
prepared_block.current_preset_type = choice
var/image/chosen_looks = choices[choice]
prepared_block.current_target = chosen_looks.appearance
user.balloon_alert(user, "abstract statue selected")
/obj/structure/carving_block
name = "block"
desc = "Ready for sculpting."
icon = 'icons/obj/art/statue.dmi'
icon_state = "block"
material_flags = MATERIAL_EFFECTS | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS | MATERIAL_ADD_PREFIX
density = TRUE
material_modifier = 0.5 //50% effectiveness of materials
/// The thing it will look like - Unmodified resulting statue appearance
var/current_target
/// Currently chosen preset statue type
var/current_preset_type
//Table of required materials for each non-abstract statue type
var/static/list/statue_costs
/// statue completion from 0 to 1.0
var/completion = 0
/// Greyscaled target with cutout filter
var/mutable_appearance/target_appearance_with_filters
/// HSV color filters parameters
var/static/list/greyscale_with_value_bump = list(0,0,0, 0,0,0, 0,0,1, 0,0,-0.05)
/obj/structure/carving_block/Destroy()
current_target = null
target_appearance_with_filters = null
return ..()
/obj/structure/carving_block/proc/set_target(atom/movable/target, mob/living/user)
if(!is_viable_target(user, target))
return
if(istype(target,/obj/structure/statue/custom))
var/obj/structure/statue/custom/original = target
current_target = original.content_ma
else
current_target = target.appearance
var/mutable_appearance/ma = current_target
user.balloon_alert(user, "sculpt target is [ma.name]")
/obj/structure/carving_block/proc/reset_target()
current_target = null
current_preset_type = null
target_appearance_with_filters = null
/obj/structure/carving_block/update_overlays()
. = ..()
if(!target_appearance_with_filters)
return
//We're only keeping one instance here that changes in the middle so we have to clone it to avoid managed overlay issues
var/mutable_appearance/clone = new(target_appearance_with_filters)
. += clone
/obj/structure/carving_block/proc/is_viable_target(mob/living/user, atom/movable/target)
//Only things on turfs
if(!isturf(target.loc))
user.balloon_alert(user, "no sculpt target!")
return FALSE
//No big icon things
var/list/icon_dimensions = get_icon_dimensions(target.icon)
if(icon_dimensions["width"] != world.icon_size || icon_dimensions["height"] != world.icon_size)
user.balloon_alert(user, "sculpt target is too big!")
return FALSE
return TRUE
/obj/structure/carving_block/proc/create_statue()
if(current_preset_type)
var/obj/structure/statue/preset_statue = new current_preset_type(get_turf(src))
preset_statue.set_custom_materials(custom_materials)
qdel(src)
else if(current_target)
var/obj/structure/statue/custom/new_statue = new(get_turf(src))
new_statue.set_visuals(current_target)
new_statue.set_custom_materials(custom_materials)
var/mutable_appearance/ma = current_target
new_statue.name = "statue of [ma.name]"
new_statue.desc = "A carved statue depicting [ma.name]."
qdel(src)
/obj/structure/carving_block/proc/set_completion(value)
if(!current_target)
return
if(!target_appearance_with_filters)
target_appearance_with_filters = new(current_target)
// KEEP_APART in case carving block gets KEEP_TOGETHER from somewhere like material texture filters.
target_appearance_with_filters.appearance_flags |= KEEP_TOGETHER | KEEP_APART
//Doesn't use filter helpers because MAs aren't atoms
target_appearance_with_filters.filters = filter(type="color",color=greyscale_with_value_bump,space=FILTER_COLOR_HSV)
completion = value
var/static/icon/white = icon('icons/effects/alphacolors.dmi', "white")
switch(value)
if(0)
//delete uncovered and reset filters
remove_filter("partial_uncover")
target_appearance_with_filters = null
else
var/mask_offset = min(world.icon_size,round(completion * world.icon_size))
remove_filter("partial_uncover")
add_filter("partial_uncover", 1, alpha_mask_filter(icon = white, y = -mask_offset))
target_appearance_with_filters.filters = filter(type="alpha",icon=white,y=-mask_offset,flags=MASK_INVERSE)
update_appearance()
/// Returns a list of preset statues carvable from this block depending on the custom materials
/obj/structure/carving_block/proc/get_possible_statues()
. = list()
if(!statue_costs)
statue_costs = build_statue_cost_table()
for(var/statue_path in statue_costs)
var/list/carving_cost = statue_costs[statue_path]
var/enough_materials = TRUE
for(var/required_material in carving_cost)
if(!has_material_type(required_material, carving_cost[required_material]))
enough_materials = FALSE
break
if(enough_materials)
. += statue_path
/obj/structure/carving_block/proc/build_statue_cost_table()
. = list()
for(var/statue_type in subtypesof(/obj/structure/statue) - /obj/structure/statue/custom)
var/obj/structure/statue/S = new statue_type()
if(!S.icon_state || S.abstract_type == S.type || !S.custom_materials)
continue
.[S.type] = S.custom_materials
qdel(S)
/obj/structure/statue/custom
name = "custom statue"
icon_state = "base"
obj_flags = CAN_BE_HIT | UNIQUE_RENAME
appearance_flags = TILE_BOUND | PIXEL_SCALE | KEEP_TOGETHER | LONG_GLIDE //Added keep together in case targets has weird layering
material_flags = MATERIAL_EFFECTS | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
/// primary statue overlay
var/mutable_appearance/content_ma
var/static/list/greyscale_with_value_bump = list(0,0,0, 0,0,0, 0,0,1, 0,0,-0.05)
/obj/structure/statue/custom/Destroy()
content_ma = null
return ..()
/obj/structure/statue/custom/proc/set_visuals(model_appearance)
if(content_ma)
QDEL_NULL(content_ma)
content_ma = new
content_ma.appearance = model_appearance
content_ma.pixel_x = 0
content_ma.pixel_y = 0
content_ma.alpha = 255
var/static/list/plane_whitelist = list(FLOAT_PLANE, GAME_PLANE, FLOOR_PLANE)
/// Ideally we'd have knowledge what we're removing but i'd have to be done on target appearance retrieval
var/list/overlays_to_keep = list()
for(var/mutable_appearance/special_overlay as anything in content_ma.overlays)
var/mutable_appearance/real = new()
real.appearance = special_overlay
if(PLANE_TO_TRUE(real.plane) in plane_whitelist)
overlays_to_keep += real
content_ma.overlays = overlays_to_keep
var/list/underlays_to_keep = list()
for(var/mutable_appearance/special_underlay as anything in content_ma.underlays)
var/mutable_appearance/real = new()
real.appearance = special_underlay
if(PLANE_TO_TRUE(real.plane) in plane_whitelist)
underlays_to_keep += real
content_ma.underlays = underlays_to_keep
content_ma.appearance_flags &= ~KEEP_APART //Don't want this
content_ma.filters = filter(type="color",color=greyscale_with_value_bump,space=FILTER_COLOR_HSV)
update_content_planes()
update_appearance()
/obj/structure/statue/custom/on_changed_z_level(turf/old_turf, turf/new_turf, same_z_layer, notify_contents)
if(same_z_layer)
return ..()
update_content_planes()
update_appearance()
/obj/structure/statue/custom/proc/update_content_planes()
if(!content_ma)
return
var/turf/our_turf = get_turf(src)
// MA's stored in the overlays list are not actually mutable, they've been flattened
// This proc unflattens them, updates them, and then reapplies
var/list/created = update_appearance_planes(list(content_ma), GET_TURF_PLANE_OFFSET(our_turf))
content_ma = created[1]
/obj/structure/statue/custom/update_overlays()
. = ..()
if(content_ma)
. += content_ma
#undef SCULPT_SOUND_INCREMENT