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

Adds Umbrellas #575

Merged
merged 32 commits into from
Nov 5, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0ced948
actually fixes Volkan's shoulder companions space issue!! for real th…
Constellado Jul 30, 2024
96c5299
Merge branch 'MrMelbert:master' into master
Constellado Aug 2, 2024
a51c4e3
Merge branch 'MrMelbert:master' into master
Constellado Aug 23, 2024
4b0aa40
Simple Umbrella. Needs sprites!!
Constellado Aug 30, 2024
d6dddfe
Fix minor functionality. Still needs sprites.
Constellado Aug 30, 2024
75e3db1
offsets and inhand sprites
Constellado Aug 31, 2024
aa0e0e9
All offsets working. Start to layering.
Constellado Aug 31, 2024
ec2d154
layering!
Constellado Aug 31, 2024
38397b9
better sprites that takes advantage of the layering
Constellado Aug 31, 2024
481719d
sprite tweaks.
Constellado Aug 31, 2024
187b37e
basic umbrella sprites!
Constellado Aug 31, 2024
a73db35
fixes right hand basic umbrella dmi
Constellado Aug 31, 2024
2f54b80
black parasol item sprite
Constellado Aug 31, 2024
b4254ce
parason inhands!!
Constellado Aug 31, 2024
ed97535
fixing some issues
Constellado Aug 31, 2024
5f02212
radiation protection!!
Constellado Aug 31, 2024
b8c7dcb
adjust offset a teensy bit
Constellado Aug 31, 2024
6cef73e
Update maplestation_modules/code/game/objects/items/umbrellas.dm
Constellado Sep 1, 2024
8d94d95
Update maplestation_modules/code/game/objects/items/umbrellas.dm
Constellado Sep 1, 2024
8b060b5
a little bit of melbert's code review but its not done.
Constellado Sep 25, 2024
84bfad1
code review stuff
Constellado Sep 26, 2024
afabfa2
broken not working colours....
Constellado Sep 26, 2024
46fa820
Umbrella colours!
Constellado Sep 26, 2024
9039161
add to preferences menu
Constellado Sep 26, 2024
d6a2e13
fix sprites
Constellado Sep 26, 2024
81a319f
name updates for preferences menu
Constellado Sep 26, 2024
940291d
desc change
Constellado Sep 26, 2024
b41754a
inhands check?
Constellado Sep 26, 2024
e6cc7dc
added white
Constellado Sep 26, 2024
7245607
im dumb idk how to check for this
Constellado Sep 26, 2024
31cfac1
woopsies
Constellado Sep 26, 2024
576d626
Merge branch 'master' into umbrellas
Constellado Oct 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions maplestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -6158,6 +6158,7 @@
#include "maplestation_modules\code\game\objects\items\locker_spawners.dm"
#include "maplestation_modules\code\game\objects\items\plushes.dm"
#include "maplestation_modules\code\game\objects\items\toys.dm"
#include "maplestation_modules\code\game\objects\items\umbrellas.dm"
#include "maplestation_modules\code\game\objects\items\weaponry.dm"
#include "maplestation_modules\code\game\objects\items\devices\triage_projector.dm"
#include "maplestation_modules\code\game\objects\items\devices\PDA\PDA_types.dm"
Expand Down
111 changes: 111 additions & 0 deletions maplestation_modules/code/game/objects/items/umbrellas.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
/*
* # Umbrellas!
* This file has code for umbrellas!
* Umbrellas you can hold, and open and close.
* Currently not coding for protecting against rain as ???I dont think??? rain exists.
* The rest don't and it just for looks.
*/
/obj/item/umbrella/
Constellado marked this conversation as resolved.
Show resolved Hide resolved
name = "umbrella"
desc = "A plain white umbrella."
icon = 'maplestation_modules/icons/obj/weapons/umbrellas.dmi'
icon_state = "umbrella"
inhand_icon_state = "umbrella_closed"
lefthand_file = 'maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_lh.dmi'
righthand_file = 'maplestation_modules/icons/mob/inhands/weapons/umbrellas_inhand_rh.dmi'
force = 5
throwforce = 5
w_class = WEIGHT_CLASS_SMALL
custom_materials = list(/datum/material/iron= SMALL_MATERIAL_AMOUNT * 0.5)
attack_verb_continuous = list("bludgeons", "whacks", "disciplines", "pummels")
attack_verb_simple = list("bludgeon", "whack", "discipline", "pummel")
drop_sound = 'maplestation_modules/sound/items/drop/wooden.ogg'
pickup_sound = 'maplestation_modules/sound/items/pickup/wooden.ogg'
hitsound = 'sound/weapons/genhit1.ogg'

//open umbrella offsets for the inhands
var/open_x_offset = 2
var/open_y_offset = 2

//Whether it's open or not
var/open = FALSE

/// The sound effect played when our umbrella is opened
var/on_sound = 'sound/weapons/batonextend.ogg'
/// The inhand icon state used when our umbrella is opened.
var/on_inhand_icon_state = "umbrella_open"

/obj/item/umbrella/parasol
name = "parasol"
desc = "A black laced parsol, how intricate."
icon_state = "parasol"
inhand_icon_state = "parasol_closed"
on_inhand_icon_state = "parasol_open"


/obj/item/umbrella/Initialize(mapload)
. = ..()
AddComponent( \
/datum/component/transforming, \
force_on = 7, \
hitsound_on = "sound/weapons/genhit1.ogg", \
w_class_on = WEIGHT_CLASS_BULKY, \
clumsy_check = FALSE, \
attack_verb_continuous_on = list("swooshes", "whacks", "fwumps"), \
attack_verb_simple_on = list("swoosh", "whack", "fwump"), \
)
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform))

/obj/item/umbrella/worn_overlays(mutable_appearance/standing, isinhands)
. = ..()
if(!isinhands)
return
var/mob/holder = loc
if(open)
if(ISODD(holder.get_held_index_of_item(src))) //left hand or right hand?
. += mutable_appearance(lefthand_file, inhand_icon_state + "_BACK", BELOW_MOB_LAYER)
else
. += mutable_appearance(righthand_file, inhand_icon_state + "_BACK", BELOW_MOB_LAYER)


/obj/item/umbrella/proc/on_transform(obj/item/source, mob/user, active)
SIGNAL_HANDLER
inhand_icon_state = active ? on_inhand_icon_state : inhand_icon_state
open = active
if(user)
balloon_alert(user, active ? "opened" : "closed")
playsound(src, on_sound, 50, TRUE)
return COMPONENT_NO_DEFAULT_MESSAGE

/obj/item/umbrella/pickup(mob/user)
. = ..()
RegisterSignal(user, COMSIG_ATOM_DIR_CHANGE, PROC_REF(on_dir_change))

/obj/item/umbrella/dropped(mob/user, silent)
. = ..()
UnregisterSignal(user, COMSIG_ATOM_DIR_CHANGE)

/obj/item/umbrella/proc/on_dir_change(mob/living/carbon/owner, olddir, newdir)
SIGNAL_HANDLER
SHOULD_CALL_PARENT(TRUE)
build_worn_icon(isinhands = TRUE)
src.update_icon()
owner.update_held_items()
owner.update_appearance()
Constellado marked this conversation as resolved.
Show resolved Hide resolved

/obj/item/umbrella/get_worn_offsets(isinhands)
. = ..()
if(!isinhands)
return
var/mob/holder = loc
if(open)
.[2] += open_y_offset
switch(loc.dir)
if(NORTH)
.[1] += ISODD(holder.get_held_index_of_item(src)) ? -open_x_offset : open_x_offset
if(SOUTH)
.[1] += ISODD(holder.get_held_index_of_item(src)) ? open_x_offset : -open_x_offset
if(EAST)
.[1] -= open_x_offset
if(WEST)
.[1] += open_x_offset
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
/// the typepath of mob mob that it will turn into
var/mobtype
/// the sound the mob will make when it turns on (is created).
var/startup = 'maplestation_modules/story_content/volkan_equipment/audio/bot_startup.ogg'
var/startup = 'maplestation_modules/story_content/volkan_equipment/audio/bot_startup.ogg'
w_class = WEIGHT_CLASS_NORMAL

//activate bot action
Expand Down Expand Up @@ -112,6 +112,25 @@

w_class = WEIGHT_CLASS_TINY

///Volkan's umbrella. Stops radiation.
/obj/item/umbrella/volkan
name = "Volkan's umbrella"
desc = "A very thick, almost metallic umbrella. It has a dark black plasticky rim on the edge."
icon = 'maplestation_modules/story_content/volkan_equipment/icons/umbrellas.dmi'
icon_state = "umbrella_volkan"
inhand_icon_state = "umbrella_volkan_closed"
lefthand_file = 'maplestation_modules/story_content/volkan_equipment/icons/umbrellas_inhand_lh.dmi'
righthand_file = 'maplestation_modules/story_content/volkan_equipment/icons/umbrellas_inhand_rh.dmi'

on_inhand_icon_state = "umbrella_volkan_open"

/obj/item/umbrella/volkan/on_transform(obj/item/source, mob/user, active)
. = ..()
if(active)
ADD_TRAIT(user, TRAIT_RADIMMUNE, INNATE_TRAIT)
else
REMOVE_TRAIT(user, TRAIT_RADIMMUNE, INNATE_TRAIT)
Copy link
Owner

Choose a reason for hiding this comment

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

The way you currently have it, this trait will be permanent if you open up an umbrella and then just drop it.

Also INNATE_TRAIT is an inappropriate trait source

You'd need to add a system so that it adds the trait in pickup if it's active, removes the trait in dropped regardless if it's active or not, and then in on_transform you'd have this code still*.

Copy link
Owner

Choose a reason for hiding this comment

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

*Except I think 1. user is not nullsafe in this code, and 2. this would give people using telekinesis to open the umbrella rad immunity

Copy link
Contributor Author

@Constellado Constellado Sep 26, 2024

Choose a reason for hiding this comment

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

Okay I managed to do most of that apart from the telekinesis thing. I have NO idea how to deal with that.



//---------------------cool boxes!-----------------------

Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading