Merge with dev-freeze.

This commit is contained in:
Zuhayr
2015-07-02 19:04:01 +09:30
8 changed files with 926 additions and 931 deletions

View File

@@ -6,16 +6,13 @@
/obj/machinery/porta_turret /obj/machinery/porta_turret
name = "turret" name = "turret"
icon = 'icons/obj/turrets.dmi' icon = 'icons/obj/turrets.dmi'
icon_state = "grey_target_prism" icon_state = "turretCover"
anchored = 1 anchored = 1
layer = 3
invisibility = INVISIBILITY_LEVEL_TWO //the turret is invisible if it's inside its cover density = 0
density = 1
use_power = 1 //this turret uses and requires power use_power = 1 //this turret uses and requires power
idle_power_usage = 50 //when inactive, this turret takes up constant 50 Equipment power idle_power_usage = 50 //when inactive, this turret takes up constant 50 Equipment power
active_power_usage = 300 //when active, this turret takes up constant 300 Equipment power active_power_usage = 300 //when active, this turret takes up constant 300 Equipment power
req_access = null
req_one_access = list(access_security, access_heads)
power_channel = EQUIP //drains power from the EQUIPMENT channel power_channel = EQUIP //drains power from the EQUIPMENT channel
var/raised = 0 //if the turret cover is "open" and the turret is raised var/raised = 0 //if the turret cover is "open" and the turret is raised
@@ -34,7 +31,6 @@
var/iconholder = null //holder for the icon_state. 1 for orange sprite, null for blue. var/iconholder = null //holder for the icon_state. 1 for orange sprite, null for blue.
var/egun = null //holder to handle certain guns switching bullettypes var/egun = null //holder to handle certain guns switching bullettypes
var/obj/machinery/porta_turret_cover/cover = null //the cover that is covering this turret
var/last_fired = 0 //1: if the turret is cooling down from a shot, 0: turret is ready to fire var/last_fired = 0 //1: if the turret is cooling down from a shot, 0: turret is ready to fire
var/shot_delay = 15 //1.5 seconds between each shot var/shot_delay = 15 //1.5 seconds between each shot
@@ -60,22 +56,43 @@
var/wrenching = 0 var/wrenching = 0
var/last_target //last target fired at, prevents turrets from erratically firing at all valid targets in range var/last_target //last target fired at, prevents turrets from erratically firing at all valid targets in range
/obj/machinery/porta_turret/crescent
enabled = 0
ailock = 1
check_synth = 0
check_access = 1
check_arrest = 1
check_records = 1
check_weapons = 1
check_anomalies = 1
/obj/machinery/porta_turret/stationary /obj/machinery/porta_turret/stationary
ailock = 1
lethal = 1 lethal = 1
installation = /obj/item/weapon/gun/energy/laser installation = /obj/item/weapon/gun/energy/laser
/obj/machinery/porta_turret/New() /obj/machinery/porta_turret/New()
..() ..()
icon_state = "grey_target_prism" req_access.Cut()
req_one_access = list(access_security, access_heads)
//Sets up a spark system //Sets up a spark system
spark_system = new /datum/effect/effect/system/spark_spread spark_system = new /datum/effect/effect/system/spark_spread
spark_system.set_up(5, 0, src) spark_system.set_up(5, 0, src)
spark_system.attach(src) spark_system.attach(src)
cover = new /obj/machinery/porta_turret_cover(loc)
cover.Parent_Turret = src
setup() setup()
/obj/machinery/porta_turret/crescent/New()
..()
req_one_access.Cut()
req_access = list(access_cent_specops)
/obj/machinery/porta_turret/Destroy()
qdel(spark_system)
spark_system = null
. = ..()
/obj/machinery/porta_turret/proc/setup() /obj/machinery/porta_turret/proc/setup()
var/obj/item/weapon/gun/energy/E = installation //All energy-based weapons are applicable var/obj/item/weapon/gun/energy/E = installation //All energy-based weapons are applicable
//var/obj/item/ammo_casing/shottype = E.projectile_type //var/obj/item/ammo_casing/shottype = E.projectile_type
@@ -127,15 +144,20 @@
eshot_sound = 'sound/weapons/Laser.ogg' eshot_sound = 'sound/weapons/Laser.ogg'
egun = 1 egun = 1
var/list/turret_icons
/obj/machinery/porta_turret/update_icon() /obj/machinery/porta_turret/update_icon()
if(!anchored) if(!turret_icons)
icon_state = "turretCover" turret_icons = list()
return turret_icons["open"] = image(icon, "openTurretCover")
underlays.Cut()
underlays += turret_icons["open"]
if(stat & BROKEN) if(stat & BROKEN)
icon_state = "destroyed_target_prism" icon_state = "destroyed_target_prism"
else else if(raised || raising)
if(powered()) if(powered() && enabled)
if(enabled)
if(iconholder) if(iconholder)
//lasers have a orange icon //lasers have a orange icon
icon_state = "orange_target_prism" icon_state = "orange_target_prism"
@@ -145,13 +167,7 @@
else else
icon_state = "grey_target_prism" icon_state = "grey_target_prism"
else else
icon_state = "grey_target_prism" icon_state = "turretCover"
/obj/machinery/porta_turret/Destroy()
//deletes its own cover with it
qdel(cover)
cover = null
..()
/obj/machinery/porta_turret/proc/isLocked(mob/user) /obj/machinery/porta_turret/proc/isLocked(mob/user)
if(ailock && user.isSilicon()) if(ailock && user.isSilicon())
@@ -298,17 +314,13 @@
if(!anchored) if(!anchored)
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
anchored = 1 anchored = 1
invisibility = INVISIBILITY_LEVEL_TWO
update_icon() update_icon()
user << "<span class='notice'>You secure the exterior bolts on the turret.</span>" user << "<span class='notice'>You secure the exterior bolts on the turret.</span>"
create_cover()
else if(anchored) else if(anchored)
playsound(loc, 'sound/items/Ratchet.ogg', 100, 1) playsound(loc, 'sound/items/Ratchet.ogg', 100, 1)
anchored = 0 anchored = 0
user << "<span class='notice'>You unsecure the exterior bolts on the turret.</span>" user << "<span class='notice'>You unsecure the exterior bolts on the turret.</span>"
invisibility = 0
update_icon() update_icon()
qdel(cover) //deletes the cover, and the turret instance itself becomes its own cover.
wrenching = 0 wrenching = 0
else if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda)) else if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda))
@@ -347,6 +359,11 @@
return 1 return 1
/obj/machinery/porta_turret/proc/take_damage(var/force) /obj/machinery/porta_turret/proc/take_damage(var/force)
if(!raised && !raising)
force = force / 8
if(force < 5)
return
health -= force health -= force
if (force > 5 && prob(45)) if (force > 5 && prob(45))
spark_system.start() spark_system.start()
@@ -354,7 +371,6 @@
die() //the death process :( die() //the death process :(
/obj/machinery/porta_turret/bullet_act(obj/item/projectile/Proj) /obj/machinery/porta_turret/bullet_act(obj/item/projectile/Proj)
if(Proj.damage_type == HALLOSS) if(Proj.damage_type == HALLOSS)
return return
@@ -397,34 +413,19 @@
if (prob(25)) if (prob(25))
qdel(src) qdel(src)
else else
take_damage(150) //should instakill most turrets take_damage(initial(health) * 8) //should instakill most turrets
if (3) if (3)
take_damage(50) take_damage(initial(health) * 8 / 3)
/obj/machinery/porta_turret/proc/die() //called when the turret dies, ie, health <= 0 /obj/machinery/porta_turret/proc/die() //called when the turret dies, ie, health <= 0
health = 0 health = 0
density = 0
stat |= BROKEN //enables the BROKEN bit stat |= BROKEN //enables the BROKEN bit
invisibility = 0
spark_system.start() //creates some sparks because they look cool spark_system.start() //creates some sparks because they look cool
density = 1
update_icon() update_icon()
qdel(cover) //deletes the cover - no need on keeping it there!
/obj/machinery/porta_turret/proc/create_cover()
if(cover == null && anchored)
cover = new /obj/machinery/porta_turret_cover(loc) //if the turret has no cover and is anchored, give it a cover
cover.Parent_Turret = src //assign the cover its Parent_Turret, which would be this (src)
/obj/machinery/porta_turret/process() /obj/machinery/porta_turret/process()
//the main machinery process //the main machinery process
if(cover == null && anchored) //if it has no cover and is anchored
if(stat & BROKEN) //if the turret is borked
qdel(cover) //delete its cover, assuming it has one. Workaround for a pesky little bug
else
create_cover()
if(stat & (NOPOWER|BROKEN)) if(stat & (NOPOWER|BROKEN))
//if the turret has no power or is broken, make the turret pop down if it hasn't already //if the turret has no power or is broken, make the turret pop down if it hasn't already
popDown() popDown()
@@ -516,7 +517,7 @@
if(emagged) if(emagged)
return 10 return 10
return H.assess_perp(src, check_weapons, check_records, check_arrest) return H.assess_perp(src, check_access, check_weapons, check_records, check_arrest)
/obj/machinery/porta_turret/proc/tryToShootAt(var/list/mob/living/targets) /obj/machinery/porta_turret/proc/tryToShootAt(var/list/mob/living/targets)
if(targets.len && last_target && (last_target in targets) && target(last_target)) if(targets.len && last_target && (last_target in targets) && target(last_target))
@@ -536,14 +537,16 @@
return return
if(stat & BROKEN) if(stat & BROKEN)
return return
invisibility = 0 set_raised_raising(raised, 1)
raising = 1 update_icon()
flick("popup", cover)
var/atom/flick_holder = PoolOrNew(/atom/movable/porta_turret_cover, loc)
flick_holder.layer = layer + 0.1
flick("popup", flick_holder)
sleep(10) sleep(10)
raising = 0 qdel(flick_holder)
cover.icon_state = "openTurretCover"
raised = 1 set_raised_raising(1, 0)
layer = 4
update_icon() update_icon()
/obj/machinery/porta_turret/proc/popDown() //pops the turret down /obj/machinery/porta_turret/proc/popDown() //pops the turret down
@@ -554,16 +557,23 @@
return return
if(stat & BROKEN) if(stat & BROKEN)
return return
layer = 3 set_raised_raising(raised, 1)
raising = 1
flick("popdown", cover)
sleep(10)
raising = 0
cover.icon_state = "turretCover"
raised = 0
invisibility = INVISIBILITY_LEVEL_TWO
update_icon() update_icon()
var/atom/flick_holder = PoolOrNew(/atom/movable/porta_turret_cover, loc)
flick_holder.layer = layer + 0.1
flick("popdown", flick_holder)
sleep(10)
qdel(flick_holder)
set_raised_raising(0, 0)
update_icon()
/obj/machinery/porta_turret/proc/set_raised_raising(var/raised, var/raising)
src.raised = raised
src.raising = raising
density = raised || raising
/obj/machinery/porta_turret/proc/target(var/mob/living/target) /obj/machinery/porta_turret/proc/target(var/mob/living/target)
if(disabled) if(disabled)
return return
@@ -811,9 +821,6 @@
Turret.enabled = 0 Turret.enabled = 0
Turret.setup() Turret.setup()
// Turret.cover=new/obj/machinery/porta_turret_cover(loc)
// Turret.cover.Parent_Turret=Turret
// Turret.cover.name = finish_name
qdel(src) // qdel qdel(src) // qdel
else if(istype(I, /obj/item/weapon/crowbar)) else if(istype(I, /obj/item/weapon/crowbar))
@@ -832,6 +839,7 @@
finish_name = t finish_name = t
return return
..() ..()
@@ -857,32 +865,5 @@
/obj/machinery/porta_turret_construct/attack_ai() /obj/machinery/porta_turret_construct/attack_ai()
return return
/atom/movable/porta_turret_cover
/************************
* PORTABLE TURRET COVER *
************************/
/obj/machinery/porta_turret_cover
name = "turret"
icon = 'icons/obj/turrets.dmi' icon = 'icons/obj/turrets.dmi'
icon_state = "turretCover"
anchored = 1
layer = 3.5
density = 0
var/obj/machinery/porta_turret/Parent_Turret = null
/obj/machinery/porta_turret_cover/Destroy()
Parent_Turret = null
..()
/obj/machinery/porta_turret_cover/attack_ai(mob/user)
return attack_hand(user)
/obj/machinery/porta_turret_cover/attack_hand(mob/user)
return Parent_Turret.attack_hand(user)
/obj/machinery/porta_turret_cover/Topic(href, href_list)
Parent_Turret.Topic(href, href_list, 1) // Calling another object's Topic requires that we claim to not have a window, otherwise BYOND's base proc will runtime.
/obj/machinery/porta_turret_cover/attackby(obj/item/I, mob/user)
Parent_Turret.attackby(I, user)

View File

@@ -342,7 +342,7 @@
if(emagged) if(emagged)
return 10 return 10
return M.assess_perp(access_scanner, idcheck, check_records, check_arrest) return M.assess_perp(access_scanner, 0, idcheck, check_records, check_arrest)
/mob/living/bot/secbot/proc/patrol_step() /mob/living/bot/secbot/proc/patrol_step()
if(loc == patrol_target) if(loc == patrol_target)

View File

@@ -392,6 +392,7 @@
'html/hard-hat-exclamation.png', 'html/hard-hat-exclamation.png',
'html/image-minus.png', 'html/image-minus.png',
'html/image-plus.png', 'html/image-plus.png',
'html/map-pencil.png',
'html/music-minus.png', 'html/music-minus.png',
'html/music-plus.png', 'html/music-plus.png',
'html/tick-circle.png', 'html/tick-circle.png',

View File

@@ -626,13 +626,13 @@ proc/is_blind(A)
return client && client.inactivity < active MINUTES return client && client.inactivity < active MINUTES
#define SAFE_PERP -50 #define SAFE_PERP -50
/mob/living/proc/assess_perp(var/auth_weapons, var/check_records, var/check_arrest) /mob/living/proc/assess_perp(var/obj/access_obj, var/check_access, var/auth_weapons, var/check_records, var/check_arrest)
if(stat == DEAD) if(stat == DEAD)
return SAFE_PERP return SAFE_PERP
return 0 return 0
/mob/living/carbon/human/assess_perp(var/obj/access_obj, var/auth_weapons, var/check_records, var/check_arrest) /mob/living/carbon/human/assess_perp(var/obj/access_obj, var/check_access, var/auth_weapons, var/check_records, var/check_arrest)
var/threatcount = ..() var/threatcount = ..()
if(. == SAFE_PERP) if(. == SAFE_PERP)
return SAFE_PERP return SAFE_PERP
@@ -645,6 +645,9 @@ proc/is_blind(A)
else if(id && istype(id, /obj/item/weapon/card/id/centcom)) else if(id && istype(id, /obj/item/weapon/card/id/centcom))
return SAFE_PERP return SAFE_PERP
if(check_access && !access_obj.allowed(src))
threatcount += 4
if(auth_weapons && !access_obj.allowed(src)) if(auth_weapons && !access_obj.allowed(src))
if(istype(l_hand, /obj/item/weapon/gun) || istype(l_hand, /obj/item/weapon/melee)) if(istype(l_hand, /obj/item/weapon/gun) || istype(l_hand, /obj/item/weapon/melee))
threatcount += 4 threatcount += 4
@@ -672,7 +675,7 @@ proc/is_blind(A)
return threatcount return threatcount
/mob/living/simple_animal/hostile/assess_perp(var/obj/access_obj, var/auth_weapons, var/check_records, var/check_arrest) /mob/living/simple_animal/hostile/assess_perp(var/obj/access_obj, var/check_access, var/auth_weapons, var/check_records, var/check_arrest)
var/threatcount = ..() var/threatcount = ..()
if(. == SAFE_PERP) if(. == SAFE_PERP)
return SAFE_PERP return SAFE_PERP

View File

@@ -33,10 +33,10 @@
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread() var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
sparks.set_up(3, 0, get_turf(M)) sparks.set_up(3, 0, get_turf(M))
sparks.start() sparks.start()
//
M.Move(pick(trange(50, get_turf(holder)))) M.Move(pick(trange(50, T)))
sparks = new /datum/effect/effect/system/spark_spread() sparks = new /datum/effect/effect/system/spark_spread()
sparks.set_up(3, 0, get_turf(M)) sparks.set_up(3, 0, M.loc)
sparks.start() sparks.start()
/datum/artifact_effect/teleport/DoEffectPulse() /datum/artifact_effect/teleport/DoEffectPulse()
@@ -52,8 +52,8 @@
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread() var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
sparks.set_up(3, 0, get_turf(M)) sparks.set_up(3, 0, get_turf(M))
sparks.start() sparks.start()
//
M.loc = pick(orange(get_turf(T), 50)) M.Move(pick(trange(50, T)))
sparks = new /datum/effect/effect/system/spark_spread() sparks = new /datum/effect/effect/system/spark_spread()
sparks.set_up(3, 0, get_turf(M)) sparks.set_up(3, 0, M.loc)
sparks.start() sparks.start()

View File

@@ -259,9 +259,11 @@
if(!istype(l.glasses, /obj/item/clothing/glasses/meson)) if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
l.hallucination = max(0, min(200, l.hallucination + power * config_hallucination_power * sqrt( 1 / max(1,get_dist(l, src)) ) ) ) l.hallucination = max(0, min(200, l.hallucination + power * config_hallucination_power * sqrt( 1 / max(1,get_dist(l, src)) ) ) )
//adjusted range so that a power of 300 (pretty high) results in 8 tiles, roughly the distance from the core to the engine monitoring room. //adjusted range so that a power of 170 (pretty high) results in 9 tiles, roughly the distance from the core to the engine monitoring room.
for(var/mob/living/l in range(src, round(sqrt(power / 5)))) //note that the rads given at the maximum range is a constant 0.2 - as power increases the maximum range merely increases.
var/rads = (power / 10) * sqrt( 1 / get_dist(l, src) ) for(var/mob/living/l in range(src, round(sqrt(power / 2))))
var/radius = max(get_dist(l, src), 1)
var/rads = (power / 10) * ( 1 / (radius**2) )
l.apply_effect(rads, IRRADIATE) l.apply_effect(rads, IRRADIATE)
power -= (power/DECAY_FACTOR)**3 //energy losses due to radiation power -= (power/DECAY_FACTOR)**3 //energy losses due to radiation

View File

@@ -0,0 +1,7 @@
author: PsiOmegaDelta
delete-after: True
changes:
- tweak: "Portable turrets now only blocks movement while deployed."
- tweak: "Portable turrets are no longer invincible while undeployed, however they have increased damage resistance in this state."
- bugfix: "Crescent portable turrets should no longer act up during attempts to (un)wrench and alter their settings."

File diff suppressed because it is too large Load Diff