April sync (#360)

* Maps and things no code/icons

* helpers defines globalvars

* Onclick world.dm orphaned_procs

* subsystems

Round vote and shuttle autocall done here too

* datums

* Game folder

* Admin - chatter modules

* clothing - mining

* modular computers - zambies

* client

* mob level 1

* mob stage 2 + simple_animal

* silicons n brains

* mob stage 3 + Alien/Monkey

* human mobs

* icons updated

* some sounds

* emitter y u no commit

* update tgstation.dme

* compile fixes

* travis fixes

Also removes Fast digest mode, because reasons.

* tweaks for travis Mentors are broke again

Also fixes Sizeray guns

* oxygen loss fix for vore code.

* removes unused code

* some code updates

* bulk fixes

* further fixes

* outside things

* whoops.

* Maint bar ported

* GLOBs.
This commit is contained in:
Poojawa
2017-04-13 23:37:00 -05:00
committed by GitHub
parent cdc32c98fa
commit 7e9b96a00f
1322 changed files with 174827 additions and 23888 deletions
+5 -3
View File
@@ -37,7 +37,7 @@
var/turf/pixel_turf = get_turf_pixel(A)
var/turf_visible
if(pixel_turf)
turf_visible = cameranet.checkTurfVis(pixel_turf)
turf_visible = GLOB.cameranet.checkTurfVis(pixel_turf)
if(!turf_visible)
if(istype(loc, /obj/item/device/aicard) && (pixel_turf in view(client.view, loc)))
turf_visible = TRUE
@@ -45,7 +45,9 @@
if (pixel_turf.obscured)
log_admin("[key_name_admin(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([COORD(pixel_turf)])")
message_admins("[key_name_admin(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([ADMIN_COORDJMP(pixel_turf)]))")
send2irc_adminless_only("NOCHEAT", "[key_name(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([COORD(pixel_turf)]))")
if(REALTIMEOFDAY >= chnotify + 9000)
chnotify = REALTIMEOFDAY
send2irc_adminless_only("NOCHEAT", "[key_name(src)] might be running a modified client! (failed checkTurfVis on AI click of [A]([COORD(pixel_turf)]))")
return
var/list/modifiers = params2list(params)
@@ -188,4 +190,4 @@
//
/mob/living/silicon/ai/TurfAdjacent(var/turf/T)
return (cameranet && cameranet.checkTurfVis(T))
return (GLOB.cameranet && GLOB.cameranet.checkTurfVis(T))
+9 -13
View File
@@ -31,13 +31,16 @@
Note that this proc can be overridden, and is in the case of screen objects.
*/
/atom/Click(location,control,params)
usr.ClickOn(src, params)
if(initialized)
usr.ClickOn(src, params)
/atom/DblClick(location,control,params)
usr.DblClickOn(src,params)
if(initialized)
usr.DblClickOn(src,params)
/atom/MouseWheel(delta_x,delta_y,location,control,params)
usr.MouseWheelOn(src, delta_x, delta_y, params)
if(initialized)
usr.MouseWheelOn(src, delta_x, delta_y, params)
/*
Standard mob ClickOn()
@@ -114,10 +117,7 @@
if(A.ClickAccessible(src, depth=INVENTORY_DEPTH))
// No adjacency needed
if(W)
if(W.pre_attackby(A,src,params))
var/resolved = A.attackby(W,src)
if(!resolved && A && W)
W.afterattack(A,src,1,params) // 1 indicates adjacency
melee_item_attack_chain(src, W, A, params)
else
if(ismob(A))
changeNext_move(CLICK_CD_MELEE)
@@ -131,11 +131,7 @@
if(isturf(A) || isturf(A.loc) || (A.loc && isturf(A.loc.loc)))
if(Adjacent(A) || (W && CheckReach(src, A, W.reach))) //Adjacent or reaching attacks
if(W)
if(W.pre_attackby(A,src,params))
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
var/resolved = A.attackby(W,src,params)
if(!resolved && A && W)
W.afterattack(A,src,1,params) // 1: clicking something Adjacent
melee_item_attack_chain(src, W, A, params)
else
if(ismob(A))
changeNext_move(CLICK_CD_MELEE)
@@ -163,7 +159,7 @@
if(dummy.loc == there.loc)
qdel(dummy)
return 1
if(there.density && dummy in range(1, there)) //For windows and
if(there.density && dummy in range(1, there)) //For windows and suchlike
qdel(dummy)
return 1
if(!dummy.Move(T)) //we're blocked!
+2 -9
View File
@@ -68,11 +68,7 @@
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc in contents)
if(A == loc || (A in loc) || (A in contents))
// No adjacency checks
if(W.pre_attackby(A,src,params))
var/resolved = A.attackby(W,src, params)
if(!resolved && A && W)
W.afterattack(A,src,1,params)
melee_item_attack_chain(src, W, A, params)
return
if(!isturf(loc))
@@ -81,10 +77,7 @@
// cyborgs are prohibited from using storage items so we can I think safely remove (A.loc && isturf(A.loc.loc))
if(isturf(A) || isturf(A.loc))
if(A.Adjacent(src)) // see adjacent.dm
if(W.pre_attackby(A,src,params))
var/resolved = A.attackby(W, src, params)
if(!resolved && A && W)
W.afterattack(A, src, 1, params)
melee_item_attack_chain(src, W, A, params)
return
else
W.afterattack(A, src, 0, params)
+7 -6
View File
@@ -25,6 +25,7 @@
#define ui_lingstingdisplay "WEST:6,CENTER-3:11"
#define ui_crafting "12:-10,1:5"
#define ui_building "12:-10,1:21"
#define ui_language_menu "11:6,2:-11"
#define ui_devilsouldisplay "WEST:6,CENTER-1:15"
@@ -61,16 +62,16 @@
#define ui_borg_store "CENTER+2:16,SOUTH:5" //borgs
#define ui_borg_camera "CENTER+3:21,SOUTH:5" //borgs
#define ui_borg_album "CENTER+4:21,SOUTH:5" //borgs
#define ui_borg_talk_wheel "CENTER+4:21,SOUTH+1:5" //borgs
#define ui_borg_language_menu "CENTER+4:21,SOUTH+1:5" //borgs
#define ui_monkey_head "CENTER-4:13,SOUTH:5" //monkey
#define ui_monkey_mask "CENTER-3:14,SOUTH:5" //monkey
#define ui_monkey_neck "CENTER-2:15,SOUTH:5" //monkey
#define ui_monkey_back "CENTER-1:16,SOUTH:5" //monkey
#define ui_monkey_head "CENTER-5:13,SOUTH:5" //monkey
#define ui_monkey_mask "CENTER-4:14,SOUTH:5" //monkey
#define ui_monkey_neck "CENTER-3:15,SOUTH:5" //monkey
#define ui_monkey_back "CENTER-2:16,SOUTH:5" //monkey
#define ui_alien_storage_l "CENTER-2:14,SOUTH:5"//alien
#define ui_alien_storage_r "CENTER+1:18,SOUTH:5"//alien
#define ui_alien_talk_wheel "EAST-3:26,SOUTH:5" //alien
#define ui_alien_language_menu "EAST-3:26,SOUTH:5" //alien
#define ui_drone_drop "CENTER+1:18,SOUTH:5" //maintenance drones
#define ui_drone_pull "CENTER+2:2,SOUTH:5" //maintenance drones
+6 -1
View File
@@ -53,7 +53,7 @@
if(..())
return
var/mob/living/silicon/ai/AI = usr
crewmonitor.show(AI)
GLOB.crewmonitor.show(AI)
/obj/screen/ai/crew_manifest
name = "Crew Manifest"
@@ -167,6 +167,11 @@
..()
var/obj/screen/using
// Language menu
using = new /obj/screen/language_menu
using.screen_loc = ui_borg_language_menu
static_inventory += using
//AI core
using = new /obj/screen/ai/aicore()
using.screen_loc = ui_ai_core
+19 -22
View File
@@ -276,7 +276,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
return ..()
/obj/screen/alert/clockwork/scripture_reqs/process()
if(clockwork_gateway_activated)
if(GLOB.clockwork_gateway_activated)
qdel(src)
return
var/current_state
@@ -288,7 +288,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
icon_state = "no"
if(!current_state)
name = "Current Objective"
for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in all_clockwork_objects)
for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in GLOB.all_clockwork_objects)
var/area/gate_area = get_area(G)
desc = "<b>Protect the Ark at [gate_area.map_name]!</b>"
return
@@ -298,7 +298,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
name = "Next Tier Requirements"
var/validservants = 0
var/unconverted_ais_exist = get_unconverted_ais()
for(var/mob/living/L in living_mob_list)
for(var/mob/living/L in GLOB.living_mob_list)
if(is_servant_of_ratvar(L) && (ishuman(L) || issilicon(L)))
validservants++
var/req_servants = 0
@@ -328,14 +328,14 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
icon_state += "-servants" //in this manner, generate an icon key based on what we're missing
else
textlist += ": <b><font color=#5A6068>\[CHECK\]</font></b>"
textlist += "<br><b>[clockwork_caches]/[req_caches]</b> Tinkerer's Caches"
if(clockwork_caches < req_caches)
textlist += "<br><b>[GLOB.clockwork_caches]/[req_caches]</b> Tinkerer's Caches"
if(GLOB.clockwork_caches < req_caches)
icon_state += "-caches"
else
textlist += ": <b><font color=#5A6068>\[CHECK\]</font></b>"
if(req_cv) //cv only shows up if the tier requires it
textlist += "<br><b>[clockwork_construction_value]/[req_cv]</b> Construction Value"
if(clockwork_construction_value < req_cv)
textlist += "<br><b>[GLOB.clockwork_construction_value]/[req_cv]</b> Construction Value"
if(GLOB.clockwork_construction_value < req_cv)
icon_state += "-cv"
else
textlist += ": <b><font color=#5A6068>\[CHECK\]</font></b>"
@@ -356,7 +356,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
icon_state = "clockinfo"
/obj/screen/alert/clockwork/infodump/MouseEntered(location,control,params)
if(ratvar_awakens)
if(GLOB.ratvar_awakens)
desc = "<font size=3><b>CHETR<br>NYY<br>HAGEHUGF-NAQ-UBABE<br>RATVAR.</b></font>"
else
var/servants = 0
@@ -364,7 +364,7 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
var/unconverted_ais_exist = get_unconverted_ais()
var/list/scripture_states = scripture_unlock_check()
var/list/textlist
for(var/mob/living/L in living_mob_list)
for(var/mob/living/L in GLOB.living_mob_list)
if(is_servant_of_ratvar(L))
servants++
if(ishuman(L) || issilicon(L))
@@ -376,13 +376,13 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
textlist = list("<b>[servants]</b> Servants, [validservants ? "<b>[validservants]</b> of which counts":"none of which count"] towards scripture.<br>")
else
textlist = list("<b>[servants]</b> Servant, who [validservants ? "counts":"does not count"] towards scripture.<br>")
textlist += "<b>[clockwork_caches ? "[clockwork_caches]</b> Tinkerer's Caches.":"No Tinkerer's Caches, construct one!</b>"]<br>\
<b>[clockwork_construction_value]</b> Construction Value.<br>"
if(clockwork_daemons)
textlist += "<b>[clockwork_daemons]</b> Tinkerer's Daemons: <b>[servants * 0.2 < clockwork_daemons ? "DISABLED":"ACTIVE"]</b><br>"
textlist += "<b>[GLOB.clockwork_caches ? "[GLOB.clockwork_caches]</b> Tinkerer's Caches.":"No Tinkerer's Caches, construct one!</b>"]<br>\
<b>[GLOB.clockwork_construction_value]</b> Construction Value.<br>"
if(GLOB.clockwork_daemons)
textlist += "<b>[GLOB.clockwork_daemons]</b> Tinkerer's Daemons: <b>[servants * 0.2 < GLOB.clockwork_daemons ? "DISABLED":"ACTIVE"]</b><br>"
else
textlist += "No Tinkerer's Daemons.<br>"
for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in all_clockwork_objects)
for(var/obj/structure/destructible/clockwork/massive/celestial_gateway/G in GLOB.all_clockwork_objects)
var/area/gate_area = get_area(G)
textlist += "Ark Location: <b>[uppertext(gate_area.map_name)]</b><br>"
if(G.still_needs_components())
@@ -392,20 +392,17 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
textlist += "<b><font color=[get_component_color_bright(i)]>[G.required_components[i]]</font></b> "
textlist += "<br>"
else
if(G.ratvar_portal)
textlist += "Seconds until Ratvar's arrival: <b>[G.get_arrival_text(TRUE)]</b><br>"
else
textlist += "Seconds until Proselytization: <b>[G.get_arrival_text(TRUE)]</b><br>"
textlist += "Seconds until Ratvar's arrival: <b>[G.get_arrival_text(TRUE)]</b><br>"
if(unconverted_ais_exist)
if(unconverted_ais_exist > 1)
textlist += "<b>[unconverted_ais_exist] unconverted AIs exist!</b><br>"
else
textlist += "<b>An unconverted AI exists!</b><br>"
if(scripture_states[SCRIPTURE_REVENANT])
var/inathneq_available = clockwork_generals_invoked["inath-neq"] <= world.time
var/sevtug_available = clockwork_generals_invoked["sevtug"] <= world.time
var/nezbere_available = clockwork_generals_invoked["nezbere"] <= world.time
var/nezcrentr_available = clockwork_generals_invoked["nzcrentr"] <= world.time
var/inathneq_available = GLOB.clockwork_generals_invoked["inath-neq"] <= world.time
var/sevtug_available = GLOB.clockwork_generals_invoked["sevtug"] <= world.time
var/nezbere_available = GLOB.clockwork_generals_invoked["nezbere"] <= world.time
var/nezcrentr_available = GLOB.clockwork_generals_invoked["nzcrentr"] <= world.time
if(inathneq_available || sevtug_available || nezbere_available || nezcrentr_available)
textlist += "Generals available:<b>[inathneq_available ? "<br><font color=#1E8CE1>INATH-NEQ</font>":""][sevtug_available ? "<br><font color=#AF0AAF>SEVTUG</font>":""]\
[nezbere_available ? "<br><font color=#5A6068>NEZBERE</font>":""][nezcrentr_available ? "<br><font color=#DAAA18>NZCRENTR</font>":""]</b><br>"
+2 -3
View File
@@ -63,9 +63,8 @@
H.leap_icon.screen_loc = ui_alien_storage_r
static_inventory += H.leap_icon
using = new/obj/screen/wheel/talk
using.screen_loc = ui_alien_talk_wheel
wheels += using
using = new/obj/screen/language_menu
using.screen_loc = ui_alien_language_menu
static_inventory += using
using = new /obj/screen/drop()
+2 -3
View File
@@ -18,9 +18,8 @@
pull_icon.screen_loc = ui_pull_resist
hotkeybuttons += pull_icon
using = new/obj/screen/wheel/talk
using.screen_loc = ui_alien_talk_wheel
wheels += using
using = new/obj/screen/language_menu
using.screen_loc = ui_alien_language_menu
static_inventory += using
zone_select = new /obj/screen/zone_sel/alien()
+5 -19
View File
@@ -33,8 +33,6 @@
var/obj/screen/throw_icon
var/obj/screen/module_store_icon
var/list/wheels = list() //list of the wheel screen objects
var/list/static_inventory = list() //the screen objects which are static
var/list/toggleable_inventory = list() //the screen objects which can be hidden
var/list/obj/screen/hotkeybuttons = list() //the buttons that can be used via hotkeys
@@ -78,8 +76,6 @@
qdel(module_store_icon)
module_store_icon = null
wheels = null //all wheels are also in static_inventory
if(static_inventory.len)
for(var/thing in static_inventory)
qdel(thing)
@@ -136,15 +132,15 @@
/mob/proc/create_mob_hud()
if(client && !hud_used)
hud_used = new /datum/hud(src)
update_sight()
//Version denotes which style should be displayed. blank or 0 means "next version"
/datum/hud/proc/show_hud(version = 0,mob/viewmob)
if(!ismob(mymob))
return 0
if(!mymob.client)
return 0
var/mob/screenmob = viewmob || mymob
if(!screenmob.client)
return 0
screenmob.client.screen = list()
@@ -166,7 +162,7 @@
if(infodisplay.len)
screenmob.client.screen += infodisplay
mymob.client.screen += hide_actions_toggle
screenmob.client.screen += hide_actions_toggle
if(action_intent)
action_intent.screen_loc = initial(action_intent.screen_loc) //Restore intent selection to the original position
@@ -210,7 +206,7 @@
mymob.update_action_buttons(1)
reorganize_alerts()
mymob.reload_fullscreen()
create_parallax()
update_parallax_pref(screenmob)
/datum/hud/human/show_hud(version = 0,mob/viewmob)
@@ -227,16 +223,6 @@
/datum/hud/proc/persistent_inventory_update(mob/viewer)
if(!mymob)
return
var/mob/living/L = mymob
var/mob/screenmob = viewer || L
for(var/X in wheels)
var/obj/screen/wheel/W = X
if(W.toggled)
screenmob.client.screen |= W.buttons_list
else
screenmob.client.screen -= W.buttons_list
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
/mob/verb/button_pressed_F12()
+1 -2
View File
@@ -96,9 +96,8 @@
using.icon = ui_style
static_inventory += using
using = new/obj/screen/wheel/talk
using = new/obj/screen/language_menu
using.icon = ui_style
wheels += using
static_inventory += using
using = new /obj/screen/area_creator
+3 -5
View File
@@ -15,9 +15,8 @@
using.screen_loc = ui_movi
static_inventory += using
using = new/obj/screen/wheel/talk
using = new/obj/screen/language_menu
using.icon = ui_style
wheels += using
static_inventory += using
using = new /obj/screen/drop()
@@ -70,8 +69,7 @@
inv_box.name = "back"
inv_box.icon = ui_style
inv_box.icon_state = "back"
inv_box.icon_full = "template_small"
inv_box.screen_loc = ui_back
inv_box.screen_loc = ui_monkey_back
inv_box.slot_id = slot_back
static_inventory += inv_box
@@ -124,7 +122,7 @@
if(hud_shown)
if(M.back)
M.back.screen_loc = ui_back
M.back.screen_loc = ui_monkey_back
M.client.screen += M.back
if(M.wear_mask)
M.wear_mask.screen_loc = ui_monkey_mask
+21 -12
View File
@@ -11,9 +11,10 @@
var/parallax_layers_max = 3
var/parallax_animate_timer
/datum/hud/proc/create_parallax()
var/client/C = mymob.client
if (!apply_parallax_pref())
/datum/hud/proc/create_parallax(mob/viewmob)
var/mob/screenmob = viewmob || mymob
var/client/C = screenmob.client
if (!apply_parallax_pref(viewmob)) //don't want shit computers to crash when specing someone with insane parallax, so use the viewer's pref
return
if(!length(C.parallax_layers_cached))
@@ -27,7 +28,10 @@
C.parallax_layers.len = C.parallax_layers_max
C.screen |= (C.parallax_layers)
var/obj/screen/plane_master/PM = plane_masters["[PLANE_SPACE]"]
var/obj/screen/plane_master/PM = screenmob.hud_used.plane_masters["[PLANE_SPACE]"]
if(screenmob != mymob)
C.screen -= locate(/obj/screen/plane_master/parallax_white) in C.screen
C.screen += PM
PM.color = list(
0, 0, 0, 0,
0, 0, 0, 0,
@@ -37,15 +41,20 @@
)
/datum/hud/proc/remove_parallax()
var/client/C = mymob.client
/datum/hud/proc/remove_parallax(mob/viewmob)
var/mob/screenmob = viewmob || mymob
var/client/C = screenmob.client
C.screen -= (C.parallax_layers_cached)
var/obj/screen/plane_master/PM = plane_masters["[PLANE_SPACE]"]
var/obj/screen/plane_master/PM = screenmob.hud_used.plane_masters["[PLANE_SPACE]"]
if(screenmob != mymob)
C.screen -= locate(/obj/screen/plane_master/parallax_white) in C.screen
C.screen += PM
PM.color = initial(PM.color)
C.parallax_layers = null
/datum/hud/proc/apply_parallax_pref()
var/client/C = mymob.client
/datum/hud/proc/apply_parallax_pref(mob/viewmob)
var/mob/screenmob = viewmob || mymob
var/client/C = screenmob.client
if(C.prefs)
var/pref = C.prefs.parallax
if (isnull(pref))
@@ -75,9 +84,9 @@
C.parallax_layers_max = 3
return TRUE
/datum/hud/proc/update_parallax_pref()
remove_parallax()
create_parallax()
/datum/hud/proc/update_parallax_pref(mob/viewmob)
remove_parallax(viewmob)
create_parallax(viewmob)
// This sets which way the current shuttle is moving (returns true if the shuttle has stopped moving so the caller can append their animation)
/datum/hud/proc/set_parallax_movedir(new_parallax_movedir, skip_windups)
+8 -5
View File
@@ -3,6 +3,14 @@
icon_state = "blank"
appearance_flags = PLANE_MASTER|NO_CLIENT_COLOR
blend_mode = BLEND_OVERLAY
var/show_alpha = 255
var/hide_alpha = 0
/obj/screen/plane_master/proc/Show(override)
alpha = override || show_alpha
/obj/screen/plane_master/proc/Hide(override)
alpha = override || hide_alpha
//Why do plane masters need a backdrop sometimes? Read http://www.byond.com/forum/?post=2141928
//Trust me, you need one. Period. If you don't think you do, you're doing something extremely wrong.
@@ -19,11 +27,6 @@
blend_mode = BLEND_MULTIPLY
mouse_opacity = 0
/obj/screen/plane_master/lighting/proc/params2color(params)
color = params2list(params)
/obj/screen/plane_master/lighting/proc/basecolor()
color = LIGHTING_BASE_MATRIX
/obj/screen/plane_master/parallax
name = "parallax plane master"
plane = PLANE_SPACE_PARALLAX
+2 -3
View File
@@ -96,9 +96,8 @@
var/mob/living/silicon/robot/mymobR = mymob
var/obj/screen/using
using = new/obj/screen/wheel/talk
using.screen_loc = ui_borg_talk_wheel
wheels += using
using = new/obj/screen/language_menu
using.screen_loc = ui_borg_language_menu
static_inventory += using
//Radio
+25 -143
View File
@@ -84,6 +84,18 @@
return 1
create_area(usr)
/obj/screen/language_menu
name = "language menu"
icon = 'icons/mob/screen_midnight.dmi'
icon_state = "talk_wheel"
screen_loc = ui_language_menu
/obj/screen/language_menu/Click()
var/mob/living/L = usr
if(!istype(L))
return
L.open_language_menu(usr)
/obj/screen/inventory
var/slot_id // The indentifier for the slot. It has nothing to do with ID cards.
var/icon_empty // Icon when empty. For now used only by humans.
@@ -529,145 +541,8 @@
name = "health doll"
screen_loc = ui_healthdoll
/obj/screen/wheel
name = "wheel"
layer = HUD_LAYER
plane = HUD_PLANE
icon_state = ""
screen_loc = null //if you make a new wheel, remember to give it a screen_loc
var/list/buttons_names = list() //list of the names for each button, its length is the amount of buttons.
var/toggled = 0 //wheel is hidden/shown
var/wheel_buttons_type //the type of buttons used with this wheel.
var/list/buttons_list = list()
/obj/screen/wheel/New()
..()
build_options()
//we create the buttons for the wheel and place them in a square spiral fashion.
/obj/screen/wheel/proc/build_options()
var/obj/screen/wheel_button/close_wheel/CW = new ()
buttons_list += CW //the close option
CW.wheel = src
var/list/offset_x_list = list()
var/list/offset_y_list = list()
var/num = 1
var/N = 1
var/M = 0
var/sign = -1
my_loop:
while(offset_y_list.len < buttons_names.len)
for(var/i=1, i<=num, i++)
offset_y_list += N
offset_x_list += M
if(offset_y_list.len == buttons_names.len)
break my_loop
if(N != 0)
N = 0
M = -sign
else
N = sign
M = 0
sign = -sign
num++
var/screenx = 8
var/screeny = 8
for(var/i = 1, i <= buttons_names.len, i++)
var/obj/screen/wheel_button/WB = new wheel_buttons_type()
WB.wheel = src
buttons_list += WB
screenx += offset_x_list[i]
screeny += offset_y_list[i]
WB.screen_loc = "[screenx], [screeny]"
set_button(WB, i)
/obj/screen/wheel/proc/set_button(obj/screen/wheel_button/WB, button_number)
WB.name = buttons_names[button_number]
return
/obj/screen/wheel/Destroy()
for(var/obj/screen/S in buttons_list)
qdel(S)
return ..()
/obj/screen/wheel/Click()
if(world.time <= usr.next_move)
return
if(usr.stat)
return
if(isliving(usr))
var/mob/living/L = usr
if(toggled)
L.client.screen -= buttons_list
else
L.client.screen |= buttons_list
toggled = !toggled
/obj/screen/wheel/talk
name = "talk wheel"
icon_state = "talk_wheel"
screen_loc = "11:6,2:-11"
wheel_buttons_type = /obj/screen/wheel_button/talk
buttons_names = list("help","hello","bye","stop","thanks","come","out", "yes", "no")
var/list/word_messages = list(list("Help!","Help me!"), list("Hello.", "Hi."), list("Bye.", "Goodbye."),\
list("Stop!", "Halt!"), list("Thanks.", "Thanks!", "Thank you."), \
list("Come.", "Follow me."), list("Out!", "Go away!", "Get out!"), \
list("Yes.", "Affirmative."), list("No.", "Negative"))
/obj/screen/wheel/talk/set_button(obj/screen/wheel_button/WB, button_number)
..()
var/obj/screen/wheel_button/talk/T = WB //we already know what type the button is exactly.
T.icon_state = "talk_[T.name]"
T.word_messages = word_messages[button_number]
/obj/screen/wheel_button
name = "default wheel button"
screen_loc = "8,8"
layer = HUD_LAYER
plane = HUD_PLANE
mouse_opacity = 2
var/obj/screen/wheel/wheel
/obj/screen/wheel_button/Destroy()
wheel = null
return ..()
/obj/screen/wheel_button/close_wheel
name = "close wheel"
icon_state = "x3"
/obj/screen/wheel_button/close_wheel/Click()
if(isliving(usr))
var/mob/living/L = usr
L.client.screen -= wheel.buttons_list
wheel.toggled = !wheel.toggled
/obj/screen/wheel_button/talk
name = "talk option"
icon_state = "talk_help"
var/talk_cooldown = 0
var/list/word_messages = list()
/obj/screen/wheel_button/talk/Click(location, control,params)
if(isliving(usr))
var/mob/living/L = usr
if(L.stat)
return
if(word_messages.len && talk_cooldown < world.time)
talk_cooldown = world.time + 10
L.say(pick(word_messages))
/obj/screen/splash
icon = 'config/title_screens/images/title1.dmi'
icon = 'config/title_screens/images/blank.png'
icon_state = ""
screen_loc = "1,1"
layer = SPLASHSCREEN_LAYER
@@ -679,16 +554,23 @@
if(!visible)
alpha = 0
if(SStitle.title_screen)
icon = SStitle.title_screen.icon
if(!use_previous_title)
if(SStitle.icon)
icon = SStitle.icon
else
if(!SStitle.previous_icon)
qdel(src)
return
icon = SStitle.previous_icon
holder.screen += src
if(use_previous_title && !SSmapping.previous_map_config.defaulted)
holder.screen -= src //Yell at Cyberboss to finish this
..()
/obj/screen/splash/proc/Fade(out, qdel_after = TRUE)
if(QDELETED(src))
return
if(out)
animate(src, alpha = 0, time = 30)
else
@@ -701,4 +583,4 @@
if(holder)
holder.screen -= src
holder = null
return ..()
return ..()
+8
View File
@@ -1,4 +1,12 @@
/proc/melee_item_attack_chain(mob/user, obj/item/I, atom/target, params)
if(I.pre_attackby(target, user, params))
// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
var/resolved = target.attackby(I,user,params)
if(!resolved && target && I)
I.afterattack(target, user, 1, params) // 1: clicking something Adjacent
// 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
+3
View File
@@ -26,6 +26,9 @@
if(modifiers["shift"] && modifiers["middle"])
ShiftMiddleClickOn(A)
return
if(modifiers["shift"] && modifiers["ctrl"])
CtrlShiftClickOn(A)
return
if(modifiers["middle"])
MiddleClickOn(A)
return
+17 -16
View File
@@ -87,22 +87,23 @@
if(is_muzzled())
return
var/mob/living/carbon/ML = A
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
var/obj/item/bodypart/affecting = null
if(ishuman(ML))
var/mob/living/carbon/human/H = ML
affecting = H.get_bodypart(ran_zone(dam_zone))
var/armor = ML.run_armor_check(affecting, "melee")
if(prob(75))
ML.apply_damage(rand(1,3), BRUTE, affecting, armor)
ML.visible_message("<span class='danger'>[name] bites [ML]!</span>", \
"<span class='userdanger'>[name] bites [ML]!</span>")
if(armor >= 2)
return
for(var/datum/disease/D in viruses)
ML.ForceContractDisease(D)
else
ML.visible_message("<span class='danger'>[src] has attempted to bite [ML]!</span>")
if(istype(ML))
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
var/obj/item/bodypart/affecting = null
if(ishuman(ML))
var/mob/living/carbon/human/H = ML
affecting = H.get_bodypart(ran_zone(dam_zone))
var/armor = ML.run_armor_check(affecting, "melee")
if(prob(75))
ML.apply_damage(rand(1,3), BRUTE, affecting, armor)
ML.visible_message("<span class='danger'>[name] bites [ML]!</span>", \
"<span class='userdanger'>[name] bites [ML]!</span>")
if(armor >= 2)
return
for(var/datum/disease/D in viruses)
ML.ForceContractDisease(D)
else
ML.visible_message("<span class='danger'>[src] has attempted to bite [ML]!</span>")
/*
Aliens
+63 -99
View File
@@ -3,19 +3,35 @@
This needs more thinking out, but I might as well.
*/
var/const/tk_maxrange = 15
/*
Telekinetic attack:
By default, emulate the user's unarmed attack
*/
/atom/proc/attack_tk(mob/user)
if(user.stat)
return
new /obj/effect/overlay/temp/telekinesis(loc)
user.UnarmedAttack(src,0) // attack_hand, attack_paw, etc
return
/obj/attack_tk(mob/user)
if(user.stat)
return
var/obj/item/tk_grab/O = new(src)
O.tk_user = user
if(O.focus_object(src))
user.put_in_active_hand(O)
else
qdel(O)
..()
/mob/attack_tk(mob/user)
return
/*
This is similar to item attack_self, but applies to anything
that you can grab with a telekinetic grab.
@@ -23,37 +39,13 @@ var/const/tk_maxrange = 15
It is used for manipulating things at range, for example, opening and closing closets.
There are not a lot of defaults at this time, add more where appropriate.
*/
/atom/proc/attack_self_tk(mob/user)
return
/obj/item/attack_self_tk(mob/user)
attack_self(user)
/obj/attack_tk(mob/user)
if(user.stat)
return
if(anchored)
..()
return
var/obj/item/tk_grab/O = new(src)
user.put_in_active_hand(O)
O.host = user
O.focus_object(src)
return
/obj/item/attack_tk(mob/user)
if(user.stat)
return
var/obj/item/tk_grab/O = new(src)
user.put_in_active_hand(O)
O.host = user
O.focus_object(src)
return
/mob/attack_tk(mob/user)
return // needs more thinking about
/*
TK Grab Item (the workhorse of old TK)
@@ -74,10 +66,20 @@ var/const/tk_maxrange = 15
layer = ABOVE_HUD_LAYER
plane = ABOVE_HUD_PLANE
var/last_throw = 0
var/atom/movable/focus = null
var/mob/living/host = null
var/mob/living/carbon/tk_user = null
/obj/item/tk_grab/Initialize()
..()
START_PROCESSING(SSfastprocess, src)
/obj/item/tk_grab/Destroy()
STOP_PROCESSING(SSfastprocess, src)
return ..()
/obj/item/tk_grab/process()
if(check_if_focusable(focus)) //if somebody grabs your thing, no waiting for them to put it down and hitting them again.
update_icon()
/obj/item/tk_grab/dropped(mob/user)
if(focus && user && loc != user && loc != user.loc) // drop_item() gets called when you tk-attack a table/closet with an item
@@ -107,111 +109,73 @@ var/const/tk_maxrange = 15
/obj/item/tk_grab/afterattack(atom/target, mob/living/carbon/user, proximity, params)//TODO: go over this
if(!target || !user)
return
if(last_throw+3 > world.time)
return
if(!host || host != user)
qdel(src)
return
if(!(user.dna.check_mutation(TK)))
qdel(src)
return
if(isobj(target) && !isturf(target.loc))
return
if(!tkMaxRangeCheck(user, target, focus))
return
if(!focus)
focus_object(target, user)
focus_object(target)
return
if(focus.anchored || !isturf(focus.loc))
qdel(src)
else if(!check_if_focusable(focus))
return
if(target == focus)
target.attack_self_tk(user)
return // todo: something like attack_self not laden with assumptions inherent to attack_self
update_icon()
return
if(!isturf(target) && istype(focus,/obj/item) && target.Adjacent(focus))
var/obj/item/I = focus
var/resolved = target.attackby(I, user, params)
if(!resolved && target && I)
I.afterattack(target,user,1) // for splashing with beakers
update_icon()
apply_focus_overlay()
melee_item_attack_chain(tk_user, focus, target, params) //isn't copying the attack chain fun. we should do it more often.
if(check_if_focusable(focus))
focus.do_attack_animation(target, null, focus)
else
apply_focus_overlay()
focus.throw_at(target, 10, 1,user)
last_throw = world.time
user.changeNext_move(CLICK_CD_MELEE)
update_icon()
user.changeNext_move(CLICK_CD_MELEE)
update_icon()
/proc/tkMaxRangeCheck(mob/user, atom/target, atom/focus)
/proc/tkMaxRangeCheck(mob/user, atom/target)
var/d = get_dist(user, target)
if(focus)
d = max(d,get_dist(user,focus)) // whichever is further
if(d > tk_maxrange)
if(d > TK_MAXRANGE)
to_chat(user, "<span class ='warning'>Your mind won't reach that far.</span>")
return 0
return 1
return
return TRUE
/obj/item/tk_grab/attack(mob/living/M, mob/living/user, def_zone)
return
/obj/item/tk_grab/proc/focus_object(obj/target, mob/living/user)
if(!isobj(target))
return//Cant throw non objects atm might let it do mobs later
if(target.anchored || !isturf(target.loc))
qdel(src)
/obj/item/tk_grab/proc/focus_object(obj/target)
if(!check_if_focusable(target))
return
focus = target
update_icon()
apply_focus_overlay()
return
return TRUE
/obj/item/tk_grab/proc/check_if_focusable(obj/target)
if(!tk_user || !istype(tk_user) || QDELETED(target) || !istype(target) || !tk_user.dna.check_mutation(TK))
qdel(src)
return
if(!tkMaxRangeCheck(tk_user, target) || target.anchored || !isturf(target.loc))
qdel(src)
return
return TRUE
/obj/item/tk_grab/proc/apply_focus_overlay()
if(!focus)
return
new /obj/effect/overlay/temp/telekinesis(get_turf(focus))
/obj/item/tk_grab/update_icon()
cut_overlays()
if(focus && focus.icon && focus.icon_state)
add_overlay(icon(focus.icon,focus.icon_state))
return
if(focus)
var/old_layer = focus.layer
var/old_plane = focus.plane
focus.layer = layer+0.01
focus.plane = ABOVE_HUD_PLANE
add_overlay(focus) //this is kind of ick, but it's better than using icon()
focus.layer = old_layer
focus.plane = old_plane
/obj/item/tk_grab/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is using [user.p_their()] telekinesis to choke [user.p_them()]self! It looks like [user.p_theyre()] trying to commit suicide!</span>")
return (OXYLOSS)
/*Not quite done likely needs to use something thats not get_step_to
/obj/item/tk_grab/proc/check_path()
var/turf/ref = get_turf(src.loc)
var/turf/target = get_turf(focus.loc)
if(!ref || !target)
return 0
var/distance = get_dist(ref, target)
if(distance >= 10)
return 0
for(var/i = 1 to distance)
ref = get_step_to(ref, target, 0)
if(ref != target)
return 0
return 1
*/
//equip_to_slot_or_del(obj/item/W, slot, qdel_on_fail = 1)
/*
if(istype(user, /mob/living/carbon))
if(user:mutations & TK && get_dist(source, user) <= 7)
if(user:get_active_hand())
return 0
var/X = source:x
var/Y = source:y
var/Z = source:z
*/