Merge branch 'master' of https://github.com/PolarisSS13/Polaris into 12/16/2015_newwizard

This commit is contained in:
Neerti
2016-06-26 20:14:29 -04:00
1107 changed files with 40450 additions and 27263 deletions
+1
View File
@@ -0,0 +1 @@
#define CLICKCATCHER_PLANE -99
+11 -11
View File
@@ -121,9 +121,9 @@
/obj/machinery/door/airlock/AIShiftClick() // Opens and closes doors!
if(density)
Topic(src, list("src"= "\ref[src]", "command"="open", "activate" = "1"), 1) // 1 meaning no window (consistency!)
Topic(src, list("command"="open", "activate" = "1"))
else
Topic(src, list("src"= "\ref[src]", "command"="open", "activate" = "0"), 1)
Topic(src, list("command"="open", "activate" = "0"))
return 1
/atom/proc/AICtrlClick()
@@ -131,17 +131,17 @@
/obj/machinery/door/airlock/AICtrlClick() // Bolts doors
if(locked)
Topic(src, list("src"= "\ref[src]", "command"="bolts", "activate" = "0"), 1)// 1 meaning no window (consistency!)
Topic(src, list("command"="bolts", "activate" = "0"))
else
Topic(src, list("src"= "\ref[src]", "command"="bolts", "activate" = "1"), 1)
Topic(src, list("command"="bolts", "activate" = "1"))
return 1
/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
Topic(src, list("src"= "\ref[src]", "breaker"="1"), 1) // 1 meaning no window (consistency!)
Topic(src, list("breaker"="1"))
return 1
/obj/machinery/turretid/AICtrlClick() //turns off/on Turrets
Topic(src, list("src"= "\ref[src]", "command"="enable", "value"="[!enabled]"), 1) // 1 meaning no window (consistency!)
Topic(src, list("command"="enable", "value"="[!enabled]"))
return 1
/atom/proc/AIAltClick(var/atom/A)
@@ -150,14 +150,14 @@
/obj/machinery/door/airlock/AIAltClick() // Electrifies doors.
if(!electrified_until)
// permanent shock
Topic(src, list("src"= "\ref[src]", "command"="electrify_permanently", "activate" = "1"), 1) // 1 meaning no window (consistency!)
Topic(src, list("command"="electrify_permanently", "activate" = "1"))
else
// disable/6 is not in Topic; disable/5 disables both temporary and permanent shock
Topic(src, list("src"= "\ref[src]", "command"="electrify_permanently", "activate" = "0"), 1)
Topic(src, list("command"="electrify_permanently", "activate" = "0"))
return 1
/obj/machinery/turretid/AIAltClick() //toggles lethal on turrets
Topic(src, list("src"= "\ref[src]", "command"="lethal", "value"="[!lethal]"), 1) // 1 meaning no window (consistency!)
Topic(src, list("command"="lethal", "value"="[!lethal]"))
return 1
/atom/proc/AIMiddleClick(var/mob/living/silicon/user)
@@ -169,9 +169,9 @@
return
if(!src.lights)
Topic(src, list("src"= "\ref[src]", "command"="lights", "activate" = "1"), 1) // 1 meaning no window (consistency!)
Topic(src, list("command"="lights", "activate" = "1"))
else
Topic(src, list("src"= "\ref[src]", "command"="lights", "activate" = "0"), 1)
Topic(src, list("command"="lights", "activate" = "0"))
return 1
//
+35 -19
View File
@@ -87,6 +87,7 @@
if(in_throw_mode)
if(isturf(A) || isturf(A.loc))
throw_item(A)
trigger_aiming(TARGET_CAN_CLICK)
return 1
throw_mode_off()
@@ -94,20 +95,14 @@
if(W == A) // Handle attack_self
W.attack_self(src)
if(hand)
update_inv_l_hand(0)
else
update_inv_r_hand(0)
trigger_aiming(TARGET_CAN_CLICK)
update_inv_active_hand(0)
return 1
//Atoms on your person
// A is your location but is not a turf; or is on you (backpack); or is on something on you (box in backpack); sdepth is needed here because contents depth does not equate inventory storage depth.
var/sdepth = A.storage_depth(src)
if((!isturf(A) && A == loc) || (sdepth != -1 && sdepth <= 1))
// faster access to objects already on you
if(A.loc != src)
setMoveCooldown(10) //getting something out of a backpack
if(W)
var/resolved = W.resolve_attackby(A, src)
if(!resolved && A && W)
@@ -116,6 +111,8 @@
if(ismob(A)) // No instant mob attacking
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
UnarmedAttack(A, 1)
trigger_aiming(TARGET_CAN_CLICK)
return 1
if(!isturf(loc)) // This is going to stop you from telekinesing from inside a closet, but I don't shed many tears for that
@@ -126,8 +123,6 @@
sdepth = A.storage_depth_turf()
if(isturf(A) || isturf(A.loc) || (sdepth != -1 && sdepth <= 1))
if(A.Adjacent(src)) // see adjacent.dm
setMoveCooldown(5)
if(W)
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
var/resolved = W.resolve_attackby(A,src)
@@ -137,12 +132,15 @@
if(ismob(A)) // No instant mob attacking
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
UnarmedAttack(A, 1)
trigger_aiming(TARGET_CAN_CLICK)
return
else // non-adjacent click
if(W)
W.afterattack(A, src, 0, params) // 0: not Adjacent
else
RangedAttack(A, params)
trigger_aiming(TARGET_CAN_CLICK)
return 1
/mob/proc/setClickCooldown(var/timeout)
@@ -194,15 +192,8 @@
if((LASER in mutations) && a_intent == I_HURT)
LaserEyes(A) // moved into a proc below
else if(TK in mutations)
switch(get_dist(src,A))
if(1 to 5) // not adjacent may mean blocked by window
setMoveCooldown(2)
if(5 to 7)
setMoveCooldown(5)
if(8 to tk_maxrange)
setMoveCooldown(10)
else
return
if(get_dist(src, A) > tk_maxrange)
return
A.attack_tk(src)
/*
Restrained ClickOn
@@ -328,3 +319,28 @@
else direction = WEST
if(direction != dir)
facedir(direction)
/obj/screen/click_catcher
icon = 'icons/mob/screen_gen.dmi'
icon_state = "click_catcher"
plane = CLICKCATCHER_PLANE
mouse_opacity = 2
screen_loc = "CENTER-7,CENTER-7"
/obj/screen/click_catcher/proc/MakeGreed()
. = list()
for(var/i = 0, i<15, i++)
for(var/j = 0, j<15, j++)
var/obj/screen/click_catcher/CC = new()
CC.screen_loc = "NORTH-[i],EAST-[j]"
. += CC
/obj/screen/click_catcher/Click(location, control, params)
var/list/modifiers = params2list(params)
if(modifiers["middle"] && istype(usr, /mob/living/carbon))
var/mob/living/carbon/C = usr
C.swap_hand()
else
var/turf/T = screen_loc2turf("screen-loc", get_turf(usr))
T.Click(location, control, params)
. = 1
+3 -3
View File
@@ -68,15 +68,15 @@
update_icon()
/obj/screen/movable/ability_master/proc/open_ability_master()
var/list/screen_loc_xy = text2list(screen_loc,",")
var/list/screen_loc_xy = splittext(screen_loc,",")
//Create list of X offsets
var/list/screen_loc_X = text2list(screen_loc_xy[1],":")
var/list/screen_loc_X = splittext(screen_loc_xy[1],":")
var/x_position = decode_screen_X(screen_loc_X[1])
var/x_pix = screen_loc_X[2]
//Create list of Y offsets
var/list/screen_loc_Y = text2list(screen_loc_xy[2],":")
var/list/screen_loc_Y = splittext(screen_loc_xy[2],":")
var/y_position = decode_screen_Y(screen_loc_Y[1])
var/y_pix = screen_loc_Y[2]
+4 -2
View File
@@ -40,9 +40,9 @@
using.layer = SCREEN_LAYER
adding += using
//Crew Monitorting
//Crew Monitoring
using = new /obj/screen()
using.name = "Crew Monitorting"
using.name = "Crew Monitoring"
using.icon = 'icons/mob/screen_ai.dmi'
using.icon_state = "crew_monitor"
using.screen_loc = ui_ai_crew_monitor
@@ -130,6 +130,8 @@
using.layer = SCREEN_LAYER
adding += using
mymob.client.screen = list()
mymob.client.screen += adding + other
mymob.client.screen += mymob.client.void
return
+4 -17
View File
@@ -21,26 +21,13 @@
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_alien_health
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_alien.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_alien.dmi'
mymob.fire.icon_state = "fire0"
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
mymob.client.screen = null
mymob.client.screen += list( mymob.healths, mymob.blind, mymob.flash, mymob.fire) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
mymob.client.screen = list()
mymob.client.screen += list( mymob.healths, mymob.fire) //, mymob.rest, mymob.sleep, mymob.mach )
mymob.client.screen += src.adding + src.other
mymob.client.screen += mymob.client.void
+118
View File
@@ -0,0 +1,118 @@
#define FULLSCREEN_LAYER 18
#define DAMAGE_LAYER FULLSCREEN_LAYER + 0.1
#define BLIND_LAYER DAMAGE_LAYER + 0.1
#define CRIT_LAYER BLIND_LAYER + 0.1
/mob
var/list/screens = list()
/mob/proc/set_fullscreen(condition, screen_name, screen_type, arg)
condition ? overlay_fullscreen(screen_name, screen_type, arg) : clear_fullscreen(screen_name)
/mob/proc/overlay_fullscreen(category, type, severity)
var/obj/screen/fullscreen/screen = screens[category]
if(screen)
if(screen.type != type)
clear_fullscreen(category, FALSE)
screen = null
else if(!severity || severity == screen.severity)
return null
if(!screen)
screen = PoolOrNew(type)
screen.icon_state = "[initial(screen.icon_state)][severity]"
screen.severity = severity
screens[category] = screen
if(client && stat != DEAD)
client.screen += screen
return screen
/mob/proc/clear_fullscreen(category, animated = 10)
var/obj/screen/fullscreen/screen = screens[category]
if(!screen)
return
screens -= category
if(animated)
spawn(0)
animate(screen, alpha = 0, time = animated)
sleep(animated)
if(client)
client.screen -= screen
qdel(screen)
else
if(client)
client.screen -= screen
qdel(screen)
/mob/proc/clear_fullscreens()
for(var/category in screens)
clear_fullscreen(category)
/mob/proc/hide_fullscreens()
if(client)
for(var/category in screens)
client.screen -= screens[category]
/mob/proc/reload_fullscreen()
if(client && stat != DEAD) //dead mob do not see any of the fullscreen overlays that he has.
for(var/category in screens)
client.screen |= screens[category]
/obj/screen/fullscreen
icon = 'icons/mob/screen_full.dmi'
icon_state = "default"
screen_loc = "CENTER-7,CENTER-7"
layer = FULLSCREEN_LAYER
mouse_opacity = 0
var/severity = 0
/obj/screen/fullscreen/Destroy()
severity = 0
return ..()
/obj/screen/fullscreen/brute
icon_state = "brutedamageoverlay"
layer = DAMAGE_LAYER
/obj/screen/fullscreen/oxy
icon_state = "oxydamageoverlay"
layer = DAMAGE_LAYER
/obj/screen/fullscreen/crit
icon_state = "passage"
layer = CRIT_LAYER
/obj/screen/fullscreen/blind
icon_state = "blackimageoverlay"
layer = BLIND_LAYER
/obj/screen/fullscreen/impaired
icon_state = "impairedoverlay"
/obj/screen/fullscreen/blurry
icon = 'icons/mob/screen1.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "blurry"
/obj/screen/fullscreen/flash
icon = 'icons/mob/screen1.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
/obj/screen/fullscreen/flash/noise
icon_state = "noise"
/obj/screen/fullscreen/high
icon = 'icons/mob/screen1.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "druggy"
#undef FULLSCREEN_LAYER
#undef BLIND_LAYER
#undef DAMAGE_LAYER
#undef CRIT_LAYER
+20 -3
View File
@@ -6,12 +6,14 @@ var/datum/global_hud/global_hud = new()
var/list/global_huds = list(
global_hud.druggy,
global_hud.blurry,
global_hud.whitense,
global_hud.vimpaired,
global_hud.darkMask,
global_hud.nvg,
global_hud.thermal,
global_hud.meson,
global_hud.science)
global_hud.science
)
/datum/hud/var/obj/screen/grab_intent
/datum/hud/var/obj/screen/hurt_intent
@@ -21,6 +23,7 @@ var/list/global_huds = list(
/datum/global_hud
var/obj/screen/druggy
var/obj/screen/blurry
var/obj/screen/whitense
var/list/vimpaired
var/list/darkMask
var/obj/screen/nvg
@@ -53,6 +56,14 @@ var/list/global_huds = list(
blurry.layer = 17
blurry.mouse_opacity = 0
//static overlay effect for cameras and the like
whitense = new /obj/screen()
whitense.screen_loc = ui_entire_screen
whitense.icon = 'icons/effects/static.dmi'
whitense.icon_state = "1 light"
whitense.layer = 17
whitense.mouse_opacity = 0
nvg = setup_overlay("nvg_hud")
thermal = setup_overlay("thermal_hud")
meson = setup_overlay("meson_hud")
@@ -260,9 +271,9 @@ datum/hud/New(mob/owner)
if(ishuman(mymob))
human_hud(ui_style, ui_color, ui_alpha, mymob) // Pass the player the UI style chosen in preferences
else if(isrobot(mymob))
robot_hud()
robot_hud(ui_style, ui_color, ui_alpha, mymob)
else if(isbrain(mymob))
brain_hud(ui_style)
mymob.instantiate_hud(src)
else if(isalien(mymob))
larva_hud()
else if(isslime(mymob))
@@ -375,3 +386,9 @@ datum/hud/New(mob/owner)
hud_used.hidden_inventory_update()
hud_used.persistant_inventory_update()
update_action_buttons()
/mob/proc/add_click_catcher()
client.screen += client.void
/mob/new_player/add_click_catcher()
return
+6 -34
View File
@@ -162,7 +162,7 @@
inv_box.name = "r_hand"
inv_box.icon = ui_style
inv_box.icon_state = "r_hand_inactive"
if(mymob && !mymob.hand) //This being 0 or null means the right hand is in use
if(!target.hand) //This being 0 or null means the right hand is in use
inv_box.icon_state = "r_hand_active"
inv_box.screen_loc = ui_rhand
inv_box.slot_id = slot_r_hand
@@ -177,7 +177,7 @@
inv_box.name = "l_hand"
inv_box.icon = ui_style
inv_box.icon_state = "l_hand_inactive"
if(mymob && mymob.hand) //This being 1 means the left hand is in use
if(target.hand) //This being 1 means the left hand is in use
inv_box.icon_state = "l_hand_active"
inv_box.screen_loc = ui_lhand
inv_box.slot_id = slot_l_hand
@@ -313,31 +313,6 @@
mymob.wiz_energy_display.icon_state = "wiz_energy"
hud_elements |= mymob.wiz_energy_display
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.mouse_opacity = 0
mymob.blind.layer = 0
hud_elements |= mymob.blind
mymob.damageoverlay = new /obj/screen()
mymob.damageoverlay.icon = 'icons/mob/screen1_full.dmi'
mymob.damageoverlay.icon_state = "oxydamageoverlay0"
mymob.damageoverlay.name = "dmg"
mymob.damageoverlay.screen_loc = "1,1"
mymob.damageoverlay.mouse_opacity = 0
mymob.damageoverlay.layer = 18.1 //The black screen overlay sets layer to 18 to display it, this one has to be just on top.
hud_elements |= mymob.damageoverlay
mymob.flash = new /obj/screen()
mymob.flash.icon = ui_style
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
hud_elements |= mymob.flash
mymob.pain = new /obj/screen( null )
@@ -371,11 +346,12 @@
mymob.radio_use_icon.color = ui_color
mymob.radio_use_icon.alpha = ui_alpha
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += hud_elements
mymob.client.screen += src.adding + src.hotkeybuttons
inventory_shown = 0;
mymob.client.screen += mymob.client.void
inventory_shown = 0
return
@@ -397,10 +373,7 @@
f_style = "Shaved"
if(dna.species == "Human") //no more xenos losing ears/tentacles
h_style = pick("Bedhead", "Bedhead 2", "Bedhead 3")
undershirt = null
underwear_top = null
underwear_bottom = null
socks = null
all_underwear.Cut()
regenerate_icons()
/obj/screen/ling
@@ -416,7 +389,6 @@
/obj/screen/wizard/instability
name = "instability"
icon_state = "instability-1"
invisibility = 0
/obj/screen/wizard/energy
name = "energy"
+3 -3
View File
@@ -27,13 +27,13 @@
return
//Split screen-loc up into X+Pixel_X and Y+Pixel_Y
var/list/screen_loc_params = text2list(PM["screen-loc"], ",")
var/list/screen_loc_params = splittext(PM["screen-loc"], ",")
//Split X+Pixel_X up into list(X, Pixel_X)
var/list/screen_loc_X = text2list(screen_loc_params[1],":")
var/list/screen_loc_X = splittext(screen_loc_params[1],":")
screen_loc_X[1] = encode_screen_X(text2num(screen_loc_X[1]))
//Split Y+Pixel_Y up into list(Y, Pixel_Y)
var/list/screen_loc_Y = text2list(screen_loc_params[2],":")
var/list/screen_loc_Y = splittext(screen_loc_params[2],":")
screen_loc_Y[1] = encode_screen_Y(text2num(screen_loc_Y[1]))
if(snap2grid) //Discard Pixel Values
+7 -19
View File
@@ -5,14 +5,6 @@
/datum/hud/proc/ghost_hud()
return
/datum/hud/proc/brain_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
/datum/hud/proc/blob_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
blobpwrdisplay = new /obj/screen()
@@ -27,9 +19,10 @@
blobhealthdisplay.screen_loc = ui_internal
blobhealthdisplay.layer = 20
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += list(blobpwrdisplay, blobhealthdisplay)
mymob.client.screen += mymob.client.void
/datum/hud/proc/slime_hud(ui_style = 'icons/mob/screen1_Midnight.dmi')
@@ -94,8 +87,9 @@
src.adding += using
hurt_intent = using
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += src.adding
mymob.client.screen += mymob.client.void
return
@@ -114,13 +108,6 @@
else if(istype(mymob,/mob/living/simple_animal/construct/harvester))
constructtype = "harvester"
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
if(constructtype)
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_construct.dmi'
@@ -151,6 +138,7 @@
mymob.purged.name = "purged"
mymob.purged.screen_loc = ui_construct_purge
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += list(mymob.fire, mymob.healths, mymob.pullin, mymob.zone_sel, mymob.purged, mymob.flash)
mymob.client.screen += list(mymob.fire, mymob.healths, mymob.pullin, mymob.zone_sel, mymob.purged)
mymob.client.screen += mymob.client.void
+70 -33
View File
@@ -1,7 +1,20 @@
var/obj/screen/robot_inventory
/*
/mob/living/silicon/robot/instantiate_hud(var/datum/hud/HUD, var/ui_style, var/ui_color, var/ui_alpha)
HUD.robot_hud(ui_style, ui_color, ui_alpha, src)*/
/datum/hud/proc/robot_hud(ui_style='icons/mob/screen1_robot.dmi', var/ui_color = "#ffffff", var/ui_alpha = 255, var/mob/living/silicon/robot/target)
/* var/datum/hud_data/hud_data
if(!istype(target))
hud_data = new()
/datum/hud/proc/robot_hud()
if(hud_data.icon)
ui_style = hud_data.icon*/
if(ui_style == 'icons/mob/screen/minimalist.dmi')
ui_style = 'icons/mob/screen1_robot_minimalist.dmi'
else
ui_style = 'icons/mob/screen1_robot.dmi'
src.adding = list()
src.other = list()
@@ -12,7 +25,9 @@ var/obj/screen/robot_inventory
using = new /obj/screen()
using.name = "radio"
using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon = ui_style
using.color = ui_color
using.alpha = ui_alpha
using.icon_state = "radio"
using.screen_loc = ui_movi
using.layer = 20
@@ -23,7 +38,9 @@ var/obj/screen/robot_inventory
using = new /obj/screen()
using.name = "module1"
using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon = ui_style
using.color = ui_color
using.alpha = ui_alpha
using.icon_state = "inv1"
using.screen_loc = ui_inv1
using.layer = 20
@@ -33,7 +50,9 @@ var/obj/screen/robot_inventory
using = new /obj/screen()
using.name = "module2"
using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon = ui_style
using.color = ui_color
using.alpha = ui_alpha
using.icon_state = "inv2"
using.screen_loc = ui_inv2
using.layer = 20
@@ -43,7 +62,9 @@ var/obj/screen/robot_inventory
using = new /obj/screen()
using.name = "module3"
using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon = ui_style
using.color = ui_color
using.alpha = ui_alpha
using.icon_state = "inv3"
using.screen_loc = ui_inv3
using.layer = 20
@@ -56,7 +77,8 @@ var/obj/screen/robot_inventory
using = new /obj/screen()
using.name = "act_intent"
using.set_dir(SOUTHWEST)
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon = ui_style
using.alpha = ui_alpha
using.icon_state = mymob.a_intent
using.screen_loc = ui_acti
using.layer = 20
@@ -65,47 +87,60 @@ var/obj/screen/robot_inventory
//Cell
mymob:cells = new /obj/screen()
mymob:cells.icon = 'icons/mob/screen1_robot.dmi'
mymob:cells.icon = ui_style
mymob:cells.icon_state = "charge-empty"
mymob:cells.alpha = ui_alpha
mymob:cells.name = "cell"
mymob:cells.screen_loc = ui_toxin
src.other += mymob:cells
//Health
mymob.healths = new /obj/screen()
mymob.healths.icon = 'icons/mob/screen1_robot.dmi'
mymob.healths.icon = ui_style
mymob.healths.icon_state = "health0"
mymob.healths.alpha = ui_alpha
mymob.healths.name = "health"
mymob.healths.screen_loc = ui_borg_health
src.other += mymob.healths
//Installed Module
mymob.hands = new /obj/screen()
mymob.hands.icon = 'icons/mob/screen1_robot.dmi'
mymob.hands.icon = ui_style
mymob.hands.icon_state = "nomod"
mymob.hands.alpha = ui_alpha
mymob.hands.name = "module"
mymob.hands.screen_loc = ui_borg_module
src.other += mymob.hands
//Module Panel
using = new /obj/screen()
using.name = "panel"
using.icon = 'icons/mob/screen1_robot.dmi'
using.icon = ui_style
using.icon_state = "panel"
using.alpha = ui_alpha
using.screen_loc = ui_borg_panel
using.layer = 19
src.adding += using
//Store
mymob.throw_icon = new /obj/screen()
mymob.throw_icon.icon = 'icons/mob/screen1_robot.dmi'
mymob.throw_icon.icon = ui_style
mymob.throw_icon.icon_state = "store"
mymob.throw_icon.alpha = ui_alpha
mymob.throw_icon.color = ui_color
mymob.throw_icon.name = "store"
mymob.throw_icon.screen_loc = ui_borg_store
src.other += mymob.throw_icon
//Inventory
robot_inventory = new /obj/screen()
robot_inventory.name = "inventory"
robot_inventory.icon = 'icons/mob/screen1_robot.dmi'
robot_inventory.icon = ui_style
robot_inventory.icon_state = "inventory"
robot_inventory.alpha = ui_alpha
robot_inventory.color = ui_color
robot_inventory.screen_loc = ui_borg_inventory
src.other += robot_inventory
//Temp
mymob.bodytemp = new /obj/screen()
@@ -113,54 +148,56 @@ var/obj/screen/robot_inventory
mymob.bodytemp.name = "body temperature"
mymob.bodytemp.screen_loc = ui_temp
mymob.oxygen = new /obj/screen()
mymob.oxygen.icon = 'icons/mob/screen1_robot.dmi'
mymob.oxygen.icon = ui_style
mymob.oxygen.icon_state = "oxy0"
mymob.oxygen.alpha = ui_alpha
mymob.oxygen.name = "oxygen"
mymob.oxygen.screen_loc = ui_oxygen
src.other += mymob.oxygen
mymob.fire = new /obj/screen()
mymob.fire.icon = 'icons/mob/screen1_robot.dmi'
mymob.fire.icon = ui_style
mymob.fire.icon_state = "fire0"
mymob.fire.alpha = ui_alpha
mymob.fire.name = "fire"
mymob.fire.screen_loc = ui_fire
src.other += mymob.fire
mymob.pullin = new /obj/screen()
mymob.pullin.icon = 'icons/mob/screen1_robot.dmi'
mymob.pullin.icon = ui_style
mymob.pullin.icon_state = "pull0"
mymob.pullin.alpha = ui_alpha
mymob.pullin.color = ui_color
mymob.pullin.name = "pull"
mymob.pullin.screen_loc = ui_borg_pull
mymob.blind = new /obj/screen()
mymob.blind.icon = 'icons/mob/screen1_full.dmi'
mymob.blind.icon_state = "blackimageoverlay"
mymob.blind.name = " "
mymob.blind.screen_loc = "1,1"
mymob.blind.layer = 0
mymob.flash = new /obj/screen()
mymob.flash.icon = 'icons/mob/screen1_robot.dmi'
mymob.flash.icon_state = "blank"
mymob.flash.name = "flash"
mymob.flash.screen_loc = ui_entire_screen
mymob.flash.layer = 17
src.other += mymob.pullin
mymob.zone_sel = new /obj/screen/zone_sel()
mymob.zone_sel.icon = 'icons/mob/screen1_robot.dmi'
mymob.zone_sel.icon = ui_style
mymob.zone_sel.alpha = ui_alpha
mymob.zone_sel.overlays.Cut()
mymob.zone_sel.overlays += image('icons/mob/zone_sel.dmi', "[mymob.zone_sel.selecting]")
//Handle the gun settings buttons
mymob.gun_setting_icon = new /obj/screen/gun/mode(null)
mymob.gun_setting_icon.icon = ui_style
mymob.gun_setting_icon.alpha = ui_alpha
mymob.item_use_icon = new /obj/screen/gun/item(null)
mymob.item_use_icon.icon = ui_style
mymob.item_use_icon.alpha = ui_alpha
mymob.gun_move_icon = new /obj/screen/gun/move(null)
mymob.gun_move_icon.icon = ui_style
mymob.gun_move_icon.alpha = ui_alpha
mymob.radio_use_icon = new /obj/screen/gun/radio(null)
mymob.radio_use_icon.icon = ui_style
mymob.radio_use_icon.alpha = ui_alpha
mymob.client.screen = null
mymob.client.screen = list()
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, mymob.blind, mymob.flash, robot_inventory, mymob.gun_setting_icon)
mymob.client.screen += list( mymob.throw_icon, mymob.zone_sel, mymob.oxygen, mymob.fire, mymob.hands, mymob.healths, mymob:cells, mymob.pullin, robot_inventory, mymob.gun_setting_icon)
mymob.client.screen += src.adding + src.other
mymob.client.screen += mymob.client.void
return
+1 -1
View File
@@ -420,7 +420,7 @@
var/mob/living/silicon/ai/AI = usr
AI.toggle_camera_light()
if("Crew Monitorting")
if("Crew Monitoring")
if(isAI(usr))
var/mob/living/silicon/ai/AI = usr
AI.subsystem_crew_monitor()
+3 -3
View File
@@ -57,15 +57,15 @@
overlays.Add(open_state)
/obj/screen/movable/spell_master/proc/open_spellmaster()
var/list/screen_loc_xy = text2list(screen_loc,",")
var/list/screen_loc_xy = splittext(screen_loc,",")
//Create list of X offsets
var/list/screen_loc_X = text2list(screen_loc_xy[1],":")
var/list/screen_loc_X = splittext(screen_loc_xy[1],":")
var/x_position = decode_screen_X(screen_loc_X[1])
var/x_pix = screen_loc_X[2]
//Create list of Y offsets
var/list/screen_loc_Y = text2list(screen_loc_xy[2],":")
var/list/screen_loc_Y = splittext(screen_loc_xy[2],":")
var/y_position = decode_screen_Y(screen_loc_Y[1])
var/y_pix = screen_loc_Y[2]
+51 -60
View File
@@ -1,40 +1,59 @@
/*
=== Item Click Call Sequences ===
These are the default click code call sequences used when clicking on stuff with an item.
Atoms:
mob/ClickOn() calls the item's resolve_attackby() proc.
item/resolve_attackby() calls the target atom's attackby() proc.
Mobs:
mob/living/attackby() after checking for surgery, calls the item's attack() proc.
item/attack() generates attack logs, sets click cooldown and calls the mob's attacked_with_item() proc. If you override this, consider whether you need to set a click cooldown, play attack animations, and generate logs yourself.
mob/attacked_with_item() should then do mob-type specific stuff (like determining hit/miss, handling shields, etc) and then possibly call the item's apply_hit_effect() proc to actually apply the effects of being hit.
Item Hit Effects:
item/apply_hit_effect() can be overriden to do whatever you want. However "standard" physical damage based weapons should make use of the target mob's hit_with_weapon() proc to
avoid code duplication. This includes items that may sometimes act as a standard weapon in addition to having other effects (e.g. stunbatons on harm intent).
*/
// Called when the item is in the active hand, and clicked; alternately, there is an 'activate held object' verb or you can hit pagedown.
/obj/item/proc/attack_self(mob/user)
return
//I would prefer to rename this to attack(), but that would involve touching hundreds of files.
/obj/item/proc/resolve_attackby(atom/A, mob/user)
add_fingerprint(user)
return A.attackby(src, user)
// No comment
/atom/proc/attackby(obj/item/W, mob/user)
return
/atom/movable/attackby(obj/item/W, mob/user)
if(!(W.flags&NOBLUDGEON))
if(!(W.flags & NOBLUDGEON))
visible_message("<span class='danger'>[src] has been hit by [user] with [W].</span>")
/mob/living/attackby(obj/item/I, mob/user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
if(istype(I) && ismob(user))
I.attack(src, user)
if(!ismob(user))
return 0
if(can_operate(src) && I.do_surgery(src,user)) //Surgery
return 1
return I.attack(src, user, user.zone_sel.selecting)
// Proximity_flag is 1 if this afterattack was called on something adjacent, in your square, or on your person.
// Click parameters is the params string from byond Click() code, see that documentation.
/obj/item/proc/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
return
//TODO: refactor mob attack code.
/*
Busy writing something else that I don't want to get mixed up in a general attack code, and I don't want to forget this so leaving a note here.
leave attackby() as handling the general case of "using an item on a mob"
attackby() will decide to call attacked_by() or not.
attacked_by() will be made a living level proc and handle the specific case of "attacking with an item to cause harm"
attacked_by() will then call attack() so that stunbatons and other weapons that have special attack effects can do their thing.
attacked_by() will handle hitting/missing/logging as it does now, and will call attack() to apply the attack effects (damage) instead of the other way around (as it is now).
*/
/obj/item/proc/attack(mob/living/M as mob, mob/living/user as mob, def_zone)
if(!istype(M) || (can_operate(M) && do_surgery(M,user,src))) return 0
//I would prefer to rename this attack_as_weapon(), but that would involve touching hundreds of files.
/obj/item/proc/attack(mob/living/M, mob/living/user, var/target_zone)
if(!force || (flags & NOBLUDGEON))
return 0
if(M == user && user.a_intent != I_HURT)
return 0
/////////////////////////
user.lastattacked = M
@@ -46,50 +65,22 @@ attacked_by() will handle hitting/missing/logging as it does now, and will call
msg_admin_attack("[key_name(user)] attacked [key_name(M)] with [name] (INTENT: [uppertext(user.a_intent)]) (DAMTYE: [uppertext(damtype)])" )
/////////////////////////
// Attacking someone with a weapon while they are neck-grabbed
if(user.a_intent == I_HURT)
for(var/obj/item/weapon/grab/G in M.grabbed_by)
if(G.assailant == user && G.state >= GRAB_NECK)
M.attack_throat(src, G, user)
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
user.do_attack_animation(M)
var/hit_zone = M.resolve_item_attack(src, user, target_zone)
if(hit_zone)
apply_hit_effect(M, user, hit_zone)
return 1
//Called when a weapon is used to make a successful melee attack on a mob. Returns the blocked result
/obj/item/proc/apply_hit_effect(mob/living/target, mob/living/user, var/hit_zone)
if(hitsound)
playsound(loc, hitsound, 50, 1, -1)
var/power = force
if(HULK in user.mutations)
power *= 2
return target.hit_with_weapon(src, user, power, hit_zone)
// TODO: needs to be refactored into a mob/living level attacked_by() proc. ~Z
user.do_attack_animation(M)
user.break_cloak()
if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
// Handle striking to cripple.
var/dislocation_str
if(user.a_intent == I_DISARM)
dislocation_str = H.attack_joint(src, user, def_zone)
if(H.attacked_by(src, user, def_zone) && hitsound)
playsound(loc, hitsound, 50, 1, -1)
spawn(1) //ugh I hate this but I don't want to root through human attack procs to print it after this call resolves.
if(dislocation_str) user.visible_message("<span class='danger'>[dislocation_str]</span>")
return 1
return 0
else
if(attack_verb.len)
user.visible_message("<span class='danger'>[M] has been [pick(attack_verb)] with [src] by [user]!</span>")
else
user.visible_message("<span class='danger'>[M] has been attacked with [src] by [user]!</span>")
if (hitsound)
playsound(loc, hitsound, 50, 1, -1)
switch(damtype)
if("brute")
M.take_organ_damage(power)
if(prob(33)) // Added blood for whacking non-humans too
var/turf/simulated/location = get_turf(M)
if(istype(location)) location.add_blood_floor(M)
if("fire")
if (!(COLD_RESISTANCE in M.mutations))
M.take_organ_damage(0, power)
M << "Aargh it burns!"
M.updatehealth()
add_fingerprint(user)
return 1
+6 -7
View File
@@ -1,5 +1,5 @@
/client/var/inquisitive_ghost = 1
/mob/dead/observer/verb/toggle_inquisition() // warning: unexpected inquisition
/mob/observer/dead/verb/toggle_inquisition() // warning: unexpected inquisition
set name = "Toggle Inquisitiveness"
set desc = "Sets whether your ghost examines everything on click by default"
set category = "Ghost"
@@ -10,25 +10,24 @@
else
src << "<span class='notice'>You will no longer examine things you click on.</span>"
/mob/dead/observer/DblClickOn(var/atom/A, var/params)
/mob/observer/dead/DblClickOn(var/atom/A, var/params)
if(client.buildmode)
build_click(src, client.buildmode, params, A)
return
if(can_reenter_corpse && mind && mind.current)
if(A == mind.current || (mind.current in A)) // double click your corpse or whatever holds it
reenter_corpse() // (cloning scanner, body bag, closet, mech, etc)
return // seems legit.
return
// Things you might plausibly want to follow
if((ismob(A) && A != src) || istype(A,/obj/singularity))
if(istype(A,/atom/movable))
ManualFollow(A)
// Otherwise jump
else
following = null
forceMove(get_turf(A))
/mob/dead/observer/ClickOn(var/atom/A, var/params)
/mob/observer/dead/ClickOn(var/atom/A, var/params)
if(client.buildmode)
build_click(src, client.buildmode, params, A)
return
@@ -39,7 +38,7 @@
A.attack_ghost(src)
// Oh by the way this didn't work with old click code which is why clicking shit didn't spam you
/atom/proc/attack_ghost(mob/dead/observer/user as mob)
/atom/proc/attack_ghost(mob/observer/dead/user as mob)
if(user.client && user.client.inquisitive_ghost)
user.examinate(src)
return
+6 -1
View File
@@ -55,6 +55,7 @@
if(!..())
return 0
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
A.attack_generic(src,rand(5,6),"bitten")
/*
@@ -76,6 +77,9 @@
Feedstop()
return
//should have already been set if we are attacking a mob, but it doesn't hurt and will cover attacking non-mobs too
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
var/mob/living/M = A
if (istype(M))
@@ -88,7 +92,7 @@
if (powerlevel > 0 && !istype(A, /mob/living/carbon/slime))
if(ishuman(M))
var/mob/living/carbon/human/H = M
stunprob *= H.species.siemens_coefficient
stunprob *= max(H.species.siemens_coefficient,0)
switch(power * 10)
@@ -144,6 +148,7 @@
custom_emote(1,"[friendly] [A]!")
return
setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
var/damage = rand(melee_damage_lower, melee_damage_upper)
if(A.attack_generic(src,damage,attacktext,environment_smash) && loc && attack_sound)
playsound(loc, attack_sound, 50, 1, 1)
+5 -14
View File
@@ -107,20 +107,11 @@ var/const/tk_maxrange = 15
return
var/d = get_dist(user, target)
if(focus) d = max(d,get_dist(user,focus)) // whichever is further
switch(d)
if(0)
;
if(1 to 5) // not adjacent may mean blocked by window
if(!proximity)
user.setMoveCooldown(2)
if(5 to 7)
user.setMoveCooldown(5)
if(8 to tk_maxrange)
user.setMoveCooldown(10)
else
user << "<span class='notice'>Your mind won't reach that far.</span>"
return
if(focus)
d = max(d, get_dist(user, focus)) // whichever is further
if(d > tk_maxrange)
user << "<span class='notice'>Your mind won't reach that far.</span>"
return
if(!focus)
focus_object(target, user)