mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 12:37:26 +01:00
reflector
This commit is contained in:
@@ -38,6 +38,10 @@
|
||||
|
||||
#define SHORT_REAL_LIMIT 16777216
|
||||
|
||||
// Real modulus that handles decimals
|
||||
#define MODULUS(x, y) ( (x) - (y) * round((x) / (y)) )
|
||||
|
||||
|
||||
//"fancy" math for calculating time in ms from tick_usage percentage and the length of ticks
|
||||
//percent_of_tick_used * (ticklag * 100(to convert to ms)) / 100(percent ratio)
|
||||
//collapsed to percent_of_tick_used * tick_lag
|
||||
@@ -53,3 +57,10 @@
|
||||
|
||||
// round() acts like floor(x, 1) by default but can't handle other values
|
||||
#define FLOOR(x, y) ( round((x) / (y)) * (y) )
|
||||
|
||||
|
||||
// Will filter out extra rotations and negative rotations
|
||||
// E.g: 540 becomes 180. -180 becomes 180.
|
||||
#define SIMPLIFY_DEGREES(degrees) (MODULUS((degrees), 360))
|
||||
|
||||
#define GET_ANGLE_OF_INCIDENCE(face, input) (MODULUS((face) - (input), 360))
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
icon = 'icons/mob/blob.dmi'
|
||||
icon_state = "blob_idle"
|
||||
desc = "Some blob creature thingy"
|
||||
health = 75
|
||||
health = 75
|
||||
fire_resist = 2
|
||||
|
||||
var/maxHealth = 75
|
||||
|
||||
/obj/structure/blob/shield/update_icon()
|
||||
if(health <= 0)
|
||||
@@ -19,3 +19,28 @@
|
||||
/obj/structure/blob/shield/CanPass(atom/movable/mover, turf/target, height=0)
|
||||
if(istype(mover) && mover.checkpass(PASSBLOB)) return 1
|
||||
return 0
|
||||
|
||||
/obj/structure/blob/shield/reflective
|
||||
name = "reflective blob"
|
||||
desc = "A solid wall of slightly twitching tendrils with a reflective glow."
|
||||
icon_state = "blob_idle_glow"
|
||||
brute_resist = 0
|
||||
health = 50
|
||||
maxHealth = 50
|
||||
var/reflect_chance = 80 //80% chance to reflect
|
||||
|
||||
/obj/structure/blob/shield/reflective/bullet_act(obj/item/projectile/P)
|
||||
if(P.is_reflectable && prob(reflect_chance) && !istype(P, /obj/item/projectile/beam/pulse))
|
||||
var/P_turf = get_turf(P)
|
||||
var/face_direction = get_dir(src, P_turf)
|
||||
var.face_angle = dir2angle(face_direction)
|
||||
var/incidence_s = GET_ANGLE_OF_INCIDENCE(face_angle, (P.Angle + 180))
|
||||
if(abs(incidence_s) > 90 && abs(incidence_s) < 270)
|
||||
return FALSE
|
||||
var/new_angle_s = SIMPLIFY_DEGREES(face_angle + incidence_s)
|
||||
P.Angle = new_angle_s
|
||||
P.firer = src //so people who fired the lasers are not immune to them when it reflects
|
||||
visible_message("<span class='warning'>[P] reflects off [src]!</span>")
|
||||
return -1// complete projectile permutation
|
||||
else
|
||||
take_damage(P.damage, P.damage_type)
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
to_chat(src, "You are the overmind and can control the blob! You can expand, which will attack people, and place new blob pieces such as...")
|
||||
to_chat(src, "<b>Normal Blob</b> will expand your reach and allow you to upgrade into special blobs that perform certain functions.")
|
||||
to_chat(src, "<b>Shield Blob</b> is a strong and expensive blob which can take more damage. It is fireproof and can block air, use this to protect yourself from station fires.")
|
||||
to_chat(src, "<b>Reflective Blob</b>is an upgraded Shield Blob which has a high chance of deflecting energy projectiles, but is vulnerable to ballistics and brute damage.")
|
||||
to_chat(src, "<b>Resource Blob</b> is a blob which will collect more resources for you, try to build these earlier to get a strong income. It will benefit from being near your core or multiple nodes, by having an increased resource rate; put it alone and it won't create resources at all.")
|
||||
to_chat(src, "<b>Node Blob</b> is a blob which will grow, like the core. Unlike the core it won't give you a small income but it can power resource and factory blobs to increase their rate.")
|
||||
to_chat(src, "<b>Factory Blob</b> is a blob which will spawn blob spores which will attack nearby food. Putting this nearby nodes and your core will increase the spawn rate; put it alone and it will not spawn any spores.")
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
/mob/camera/blob/verb/create_shield_power()
|
||||
set category = "Blob"
|
||||
set name = "Create Shield Blob (10)"
|
||||
set desc = "Create a shield blob."
|
||||
set desc = "Create a shield blob. "
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
create_shield(T)
|
||||
@@ -59,7 +59,35 @@
|
||||
|
||||
return
|
||||
|
||||
/mob/camera/blob/verb/upgrade_shield()
|
||||
set category = "Blob"
|
||||
set name = "Upgrade Shield Blob (20)"
|
||||
set desc = "Using this on an existing shield blob turns it into a reflective blob, capable of reflecting most energy projectiles but making it much weaker than usual to brute attacks."
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
|
||||
var/obj/structure/blob/shield/S = locate(/obj/structure/blob/shield) in T
|
||||
if(S)
|
||||
|
||||
if(!can_buy(20))
|
||||
return
|
||||
|
||||
if(S.health < S.maxHealth * 0.5)
|
||||
to_chat(src, "<span class='warning'>This shield blob is too damaged to be modified properly!</span>")
|
||||
return
|
||||
|
||||
if(istype(S, /obj/structure/blob/shield/reflective))
|
||||
to_chat(src, "<span class='warning'>There's already a reflector blob here!</span>")
|
||||
return
|
||||
|
||||
to_chat(src, "<span class='warning'>You secrete a reflective ooze over the shield blob, allowing it to reflect energy projectiles at the cost of reduced intregrity.</span>")
|
||||
|
||||
S.change_to(/obj/structure/blob/shield/reflective)
|
||||
S.color = blob_reagent_datum.color
|
||||
|
||||
else
|
||||
to_chat(src, "<span class='warning'>There is no shield blob here!</span>")
|
||||
return
|
||||
|
||||
/mob/camera/blob/verb/create_resource()
|
||||
set category = "Blob"
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 342 KiB After Width: | Height: | Size: 447 KiB |
Reference in New Issue
Block a user