Files
Polaris/code/modules/xenoarcheaology/effect.dm
Aronai Sieyes 715de43f35 VChat: Redone chat output done in Vue.js (#6761)
* Better notifications

* Add buttons to del/move tabs in edit mode

* Add a <span> to emotes

* Fix duplicate IDs in VChat and add more logging

* VChat: Redone chat output in Vue.js

* Ported tg asset cache

* VChat DME Update

* Replace \image macro with bicon()

* NanoUI Subsystem Fixes

Don't do this, the asset subsystem does this for you

* Allow narrate/globalnarrate shenanigans

Allows HTML if your entire thing is HTML

* Disable bicon() icon object cache, and create text tag cache

* Ore Scanner is written incorrectly

Only revealed by vchat

* Fixes 2 VChat bugs

* Underline links in VChat

* Fix LOOC color

* VChat Improvements

Hopefully, anyway.
- Arbitrary font size setting
- Line height setting
- Multiple crush settings
- Rewrote how tabs work hopefully for performance
- Hidden messages are actually put elsewhere
- Attempts to correct chat backlog restore on rejoin

* Surgery steps to use <span>

* Some VChat Tweaks

- Chat remains between client reconnects if your client didn't close (so things like using the reconnect button, or autoreconnects at round end when that feels like working)
- The client doesn't send pings to the server, the server sends pings to the client. This fixes AFK measurements for AFK kick purposes.
- Turn latency indicator into a green/red indicator to show if you're connected, and when clicked will perform a one-time ping (and block doing it again for 10 seconds). It will display '?ms' if it never got a reply, or '999ms' if it did, but it was over 1s.

* Include date in filename for VChat log save

* Merge pull request #6767 from Cyantime/patch-2

Change chat export naming scheme

* Adds VChat tab saving

Saves every time you enter/exit edit mode. Persists between rounds, VChat reloads via verb, etc.

* Fix chat exporting when someone has used unicode

Only affects clients still using 512

* Use CLIENT_FROM_VAR for ease of code reading

* Update code/modules/client/asset_cache.dm

Co-Authored-By: Novacat <35587478+Novacat@users.noreply.github.com>

* Fix runtime when client disconnects before vchat loads

* Fix polaris version of command reports

* Fix LOOC color in oldchat

* Put some styles in various adminpm messages

* Round info and advanced who spans

* Fix missing tag-end

* Maybe fix images for linux and statpanel but also doom everyone

Co-authored-by: ShadowLarkens <ShadowLarkens@users.noreply.github.com>
Co-authored-by: Novacat <35587478+Novacat@users.noreply.github.com>
2020-03-27 14:07:28 -07:00

149 lines
4.7 KiB
Plaintext

/datum/artifact_effect
var/name = "unknown"
var/effect = EFFECT_TOUCH
var/effectrange = 4
var/trigger = TRIGGER_TOUCH
var/atom/holder
var/activated = 0
var/chargelevel = 0
var/chargelevelmax = 10
var/artifact_id = ""
var/effect_type = 0
/datum/artifact_effect/New(var/atom/location)
..()
holder = location
effect = rand(0, MAX_EFFECT)
trigger = rand(0, MAX_TRIGGER)
//this will be replaced by the excavation code later, but it's here just in case
artifact_id = "[pick("kappa","sigma","antaeres","beta","omicron","iota","epsilon","omega","gamma","delta","tau","alpha")]-[rand(100,999)]"
//random charge time and distance
switch(pick(100;1, 50;2, 25;3))
if(1)
//short range, short charge time
chargelevelmax = rand(3, 20)
effectrange = rand(1, 3)
if(2)
//medium range, medium charge time
chargelevelmax = rand(15, 40)
effectrange = rand(5, 15)
if(3)
//large range, long charge time
chargelevelmax = rand(20, 120)
effectrange = rand(20, 200)
/datum/artifact_effect/proc/ToggleActivate(var/reveal_toggle = 1)
//so that other stuff happens first
spawn(0)
if(activated)
activated = 0
else
activated = 1
if(reveal_toggle && holder)
if(istype(holder, /obj/machinery/artifact))
var/obj/machinery/artifact/A = holder
A.icon_state = "ano[A.icon_num][activated]"
var/display_msg
if(activated)
display_msg = pick("momentarily glows brightly!","distorts slightly for a moment!","flickers slightly!","vibrates!","shimmers slightly for a moment!")
else
display_msg = pick("grows dull!","fades in intensity!","suddenly becomes very still!","suddenly becomes very quiet!")
var/atom/toplevelholder = holder
while(!istype(toplevelholder.loc, /turf))
toplevelholder = toplevelholder.loc
toplevelholder.visible_message("<font color='red'>[bicon(toplevelholder)] [toplevelholder] [display_msg]</font>")
/datum/artifact_effect/proc/DoEffectTouch(var/mob/user)
/datum/artifact_effect/proc/DoEffectAura(var/atom/holder)
/datum/artifact_effect/proc/DoEffectPulse(var/atom/holder)
/datum/artifact_effect/proc/UpdateMove()
/datum/artifact_effect/process()
if(chargelevel < chargelevelmax)
chargelevel++
if(activated)
if(effect == EFFECT_AURA)
DoEffectAura()
else if(effect == EFFECT_PULSE && chargelevel >= chargelevelmax)
chargelevel = 0
DoEffectPulse()
/datum/artifact_effect/proc/getDescription()
. = "<b>"
switch(effect_type)
if(EFFECT_ENERGY)
. += "Concentrated energy emissions"
if(EFFECT_PSIONIC)
. += "Intermittent psionic wavefront"
if(EFFECT_ELECTRO)
. += "Electromagnetic energy"
if(EFFECT_PARTICLE)
. += "High frequency particles"
if(EFFECT_ORGANIC)
. += "Organically reactive exotic particles"
if(EFFECT_BLUESPACE)
. += "Interdimensional/bluespace? phasing"
if(EFFECT_SYNTH)
. += "Atomic synthesis"
else
. += "Low level energy emissions"
. += "</b> have been detected <b>"
switch(effect)
if(EFFECT_TOUCH)
. += "interspersed throughout substructure and shell."
if(EFFECT_AURA)
. += "emitting in an ambient energy field."
if(EFFECT_PULSE)
. += "emitting in periodic bursts."
else
. += "emitting in an unknown way."
. += "</b>"
switch(trigger)
if(TRIGGER_TOUCH, TRIGGER_WATER, TRIGGER_ACID, TRIGGER_VOLATILE, TRIGGER_TOXIN)
. += " Activation index involves <b>physical interaction</b> with artifact surface."
if(TRIGGER_FORCE, TRIGGER_ENERGY, TRIGGER_HEAT, TRIGGER_COLD)
. += " Activation index involves <b>energetic interaction</b> with artifact surface."
if(TRIGGER_PHORON, TRIGGER_OXY, TRIGGER_CO2, TRIGGER_NITRO)
. += " Activation index involves <b>precise local atmospheric conditions</b>."
else
. += " Unable to determine any data about activation trigger."
//returns 0..1, with 1 being no protection and 0 being fully protected
/proc/GetAnomalySusceptibility(var/mob/living/carbon/human/H)
if(!istype(H))
return 1
var/protected = 0
//anomaly suits give best protection, but excavation suits are almost as good
if(istype(H.back,/obj/item/weapon/rig/hazmat))
var/obj/item/weapon/rig/hazmat/rig = H.back
if(rig.suit_is_deployed() && !rig.offline)
protected += 1
if(istype(H.wear_suit,/obj/item/clothing/suit/bio_suit/anomaly))
protected += 0.6
else if(istype(H.wear_suit,/obj/item/clothing/suit/space/anomaly))
protected += 0.5
if(istype(H.head,/obj/item/clothing/head/bio_hood/anomaly))
protected += 0.3
else if(istype(H.head,/obj/item/clothing/head/helmet/space/anomaly))
protected += 0.2
//latex gloves and science goggles also give a bit of bonus protection
if(istype(H.gloves,/obj/item/clothing/gloves/sterile))
protected += 0.1
if(istype(H.glasses,/obj/item/clothing/glasses/science))
protected += 0.1
return 1 - protected