-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
128 additions
and
14 deletions.
There are no files selected for viewing
Binary file not shown.
37 changes: 37 additions & 0 deletions
37
monkestation/code/modules/trading/unusual_effects/_unusual_component.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/datum/component/unusual_handler | ||
var/atom/source_object | ||
///the description added to the unusual. | ||
var/unusual_description = "" | ||
///the round the unusual was created at | ||
var/round_id = 0 | ||
///the particle spewer component path | ||
var/particle_path = /datum/component/particle_spewer/confetti | ||
/// The original owners name | ||
var/original_owner_ckey = "dwasint" | ||
/// the slot this item goes in used when creating the particle itself | ||
var/unusual_equip_slot = ITEM_SLOT_HEAD | ||
|
||
//this init is handled far differently than others. it parses data from the DB for information about the unusual itself | ||
//it than loads this info into the component itself, the particle_path is purely for spawning temporary ones in round | ||
/datum/component/unusual_handler/Initialize(list/parsed_variables = list(), particle_path = /datum/component/particle_spewer/confetti) | ||
. = ..() | ||
if(!length(parsed_variables)) | ||
src.particle_path = particle_path | ||
else | ||
setup_from_list(parsed_variables) | ||
|
||
source_object = parent | ||
|
||
source_object.AddComponent(particle_path) | ||
|
||
/datum/component/unusual_handler/proc/setup_from_list(list/parsed_results) | ||
return | ||
|
||
/obj/item/clothing/head/costume/chicken/confetti_unusual/Initialize(mapload) | ||
. = ..() | ||
AddComponent(/datum/component/unusual_handler) | ||
|
||
/obj/item/clothing/head/costume/chicken/snow_unusual/Initialize(mapload) | ||
. = ..() | ||
AddComponent(/datum/component/unusual_handler) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
monkestation/code/modules/trading/unusual_effects/animation_housing/snow.dm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/datum/component/particle_spewer/snow | ||
icon_file = 'monkestation/code/modules/outdoors/icons/effects/particles/particle.dmi' | ||
particle_state = "cross" | ||
burst_amount = 4 | ||
duration = 2 SECONDS | ||
|
||
/datum/component/particle_spewer/snow/animate_particle(obj/effect/abstract/particle/spawned) | ||
var/chance = rand(1, 10) | ||
switch(chance) | ||
if(1 to 2) | ||
spawned.icon_state = "cross" | ||
if(3 to 4) | ||
spawned.icon_state = "snow_2" | ||
if(5 to 6) | ||
spawned.icon_state = "snow_3" | ||
else | ||
spawned.icon_state = "snow_1" | ||
|
||
spawned.pixel_x += rand(-3, 3) | ||
spawned.pixel_y += rand(-3, 3) | ||
|
||
animate(spawned, pixel_y = spawned.pixel_y - 32, time = 2 SECONDS) | ||
animate(spawned, alpha = 25, time = 1.5 SECONDS) | ||
addtimer(CALLBACK(src, PROC_REF(delete_particle), spawned), duration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters