-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
1 parent
721973f
commit 98578af
Showing
12 changed files
with
123 additions
and
19 deletions.
There are no files selected for viewing
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
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
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,86 @@ | ||
/obj/effect/magic_orb | ||
name = "orb of wonders" | ||
desc = "A radiating magic orb. What potential does it hold?" | ||
icon = 'icons/effects/magic_orb.dmi' | ||
icon_state = "orb" | ||
anchored = TRUE | ||
var/datum/sound_token/sound_token | ||
var/sound_id | ||
var/ambient_sound = 'sound/magic/orb_ambience.ogg' | ||
|
||
/obj/effect/magic_orb/Initialize() | ||
. = ..() | ||
if(!ambient_sound) | ||
return | ||
sound_id = "[type]_[sequential_id(/obj/effect/magic_orb)]" | ||
sound_token = GLOB.sound_player.PlayLoopingSound(src, sound_id, ambient_sound, volume = 35) | ||
particles = new /particles/magic_orb() | ||
|
||
/obj/effect/magic_orb/Destroy() | ||
QDEL_NULL(sound_token) | ||
sound_token = null | ||
return ..() | ||
|
||
/obj/effect/magic_orb/attack_hand(mob/living/user) | ||
if(QDELETED(src)) // Should not be possible, but imagine | ||
return | ||
if(!CanUseOrb(user)) | ||
return | ||
SEND_GLOBAL_SIGNAL(COMSIG_GLOB_ORB_PICKUP, src, user) | ||
playsound(src, 'sound/magic/orb_pickup.ogg', 50, FALSE, 3) | ||
var/obj/effect/temp_visual/decoy/D = new /obj/effect/temp_visual/decoy(loc, dir, src, 20) | ||
animate(D, alpha = 0, color = "#aaaaff", transform = matrix()*3, time = 20) | ||
OrbEffect(user) | ||
qdel(src) | ||
return | ||
|
||
/obj/effect/magic_orb/proc/CanUseOrb(mob/living/user) | ||
return TRUE | ||
|
||
/obj/effect/magic_orb/proc/OrbEffect(mob/living/user) | ||
return | ||
|
||
/obj/effect/magic_orb/attackby(obj/item/thing, mob/user) | ||
return | ||
|
||
// Grants the user some spell points | ||
/obj/effect/magic_orb/spell_points | ||
name = "orb of knowledge" | ||
/// Amount of spell points granted to the user | ||
var/spell_points = 10 | ||
|
||
/obj/effect/magic_orb/spell_points/CanUseOrb(mob/living/user) | ||
if(!user.mind) | ||
return FALSE | ||
if(!user.mind.mana) | ||
return FALSE | ||
return ..() | ||
|
||
/obj/effect/magic_orb/spell_points/OrbEffect(mob/living/user) | ||
user.mind.mana.spell_points += spell_points | ||
show_blurb(user.client, (5 SECONDS), "The knowledge sinks into your mind...", 10, typeout = FALSE) | ||
flash_color(user, COLOR_DIAMOND, 10) | ||
return | ||
|
||
// Grants the user additional mana level and regeneration | ||
/obj/effect/magic_orb/mana | ||
name = "orb of power" | ||
/// Amount of max mana level that is added | ||
var/mana_level = 20 | ||
/// How much mana regeneration is added | ||
var/mana_regeneration = 1 | ||
|
||
/obj/effect/magic_orb/mana/CanUseOrb(mob/living/user) | ||
if(!user.mind) | ||
return FALSE | ||
if(!user.mind.mana) | ||
return FALSE | ||
return ..() | ||
|
||
/obj/effect/magic_orb/mana/OrbEffect(mob/living/user) | ||
user.mind.mana.mana_level_max += mana_level | ||
user.mind.mana.mana_level = user.mind.mana.mana_level_max | ||
user.mind.mana.mana_recharge_speed += mana_regeneration | ||
show_blurb(user.client, (5 SECONDS), "The power invigorates your mind...", 10, typeout = FALSE) | ||
flash_color(user, COLOR_DIAMOND, 10) | ||
return |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
/mob/living | ||
/datum/mind | ||
var/datum/mana/mana = /datum/mana | ||
|
||
/mob/living/Initialize() | ||
/datum/mind/New() | ||
. = ..() | ||
if(ispath(mana)) | ||
mana = new mana() | ||
|
||
/mob/living/Destroy() | ||
/datum/mind/Destroy() | ||
QDEL_NULL(mana) | ||
. = ..() |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.