mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Merge branch 'Bleeding-Edge' of https://github.com/d3athrow/vgstation13.git
This commit is contained in:
@@ -934,6 +934,7 @@
|
||||
#include "code\modules\Economy\Economy_TradeDestinations.dm"
|
||||
#include "code\modules\Economy\EFTPOS.dm"
|
||||
#include "code\modules\Economy\Job_Departments.dm"
|
||||
#include "code\modules\Economy\utils.dm"
|
||||
#include "code\modules\events\alien_infestation.dm"
|
||||
#include "code\modules\events\blob.dm"
|
||||
#include "code\modules\events\bluespaceanomaly.dm"
|
||||
|
||||
@@ -61,13 +61,21 @@ log transactions
|
||||
if(ticks_left_locked_down <= 0)
|
||||
number_incorrect_tries = 0
|
||||
|
||||
for(var/obj/item/weapon/spacecash/S in src)
|
||||
S.loc = src.loc
|
||||
if(prob(50))
|
||||
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
|
||||
else
|
||||
playsound(loc, 'sound/items/polaroid2.ogg', 50, 1)
|
||||
break
|
||||
if(authenticated_account)
|
||||
var/turf/T = get_turf(src)
|
||||
if(istype(T) && locate(/obj/item/weapon/spacecash) in T)
|
||||
var/list/cash_found = list()
|
||||
for(var/obj/item/weapon/spacecash/S in T)
|
||||
cash_found+=S
|
||||
if(cash_found.len>0)
|
||||
if(prob(50))
|
||||
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
|
||||
else
|
||||
playsound(loc, 'sound/items/polaroid2.ogg', 50, 1)
|
||||
var/amount = count_cash(cash_found)
|
||||
for(var/obj/item/weapon/spacecash/S in cash_found)
|
||||
qdel(S)
|
||||
authenticated_account.charge(-amount,null,"Credit deposit",terminal_id=machine_id)
|
||||
|
||||
/obj/machinery/atm/proc/reconnect_database()
|
||||
for(var/obj/machinery/account_database/DB in world) //Hotfix until someone finds out why it isn't in 'machines'
|
||||
@@ -87,7 +95,7 @@ log transactions
|
||||
else if(authenticated_account)
|
||||
if(istype(I,/obj/item/weapon/spacecash))
|
||||
//consume the money
|
||||
authenticated_account.money += I:worth
|
||||
authenticated_account.money += I:worth * I:amount
|
||||
if(prob(50))
|
||||
playsound(loc, 'sound/items/polaroid1.ogg', 50, 1)
|
||||
else
|
||||
|
||||
@@ -31,6 +31,14 @@
|
||||
. = i
|
||||
i = findtext(A, B, i + 1)
|
||||
|
||||
/obj/machinery/proc/getArea()
|
||||
var/area/A = loc.loc
|
||||
|
||||
if (A != myArea)
|
||||
myArea = A
|
||||
|
||||
. = myArea
|
||||
|
||||
/**
|
||||
* Object pooling.
|
||||
*
|
||||
|
||||
@@ -293,3 +293,15 @@ proc/tg_list2text(list/list, glue=",")
|
||||
if("old") return 'icons/mob/screen1_old.dmi'
|
||||
if("Orange") return 'icons/mob/screen1_Orange.dmi'
|
||||
else return 'icons/mob/screen1_Midnight.dmi'
|
||||
|
||||
/proc/num2septext(var/theNum, var/sigFig = 7,var/sep=",") // default sigFig (1,000,000)
|
||||
var/finalNum = num2text(theNum, sigFig)
|
||||
|
||||
// Start from the end, or from the decimal point
|
||||
var/end = findtextEx(finalNum, ".") || length(finalNum) + 1
|
||||
|
||||
// Moving towards start of string, insert comma every 3 characters
|
||||
for(var/pos = end - 3, pos > 1, pos -= 3)
|
||||
finalNum = copytext(finalNum, 1, pos) + sep + copytext(finalNum, pos)
|
||||
|
||||
return finalNum
|
||||
@@ -262,7 +262,7 @@ datum/controller/game_controller/proc/processMobs()
|
||||
Disease.process()
|
||||
continue
|
||||
|
||||
active_diseases = active_diseases - Disease
|
||||
active_diseases -= Disease
|
||||
|
||||
/datum/controller/game_controller/proc/processMachines()
|
||||
for (var/obj/machinery/Machinery in machines)
|
||||
@@ -276,7 +276,7 @@ datum/controller/game_controller/proc/processMobs()
|
||||
|
||||
continue
|
||||
|
||||
machines = machines - Machinery
|
||||
Machinery.removeAtProcessing()
|
||||
|
||||
/datum/controller/game_controller/proc/processObjects()
|
||||
for (var/obj/Object in processing_objects)
|
||||
@@ -285,7 +285,7 @@ datum/controller/game_controller/proc/processMobs()
|
||||
Object.process()
|
||||
continue
|
||||
|
||||
processing_objects = processing_objects - Object
|
||||
processing_objects -= Object
|
||||
|
||||
/datum/controller/game_controller/proc/processPipenets()
|
||||
last_thing_processed = /datum/pipe_network
|
||||
@@ -295,7 +295,7 @@ datum/controller/game_controller/proc/processMobs()
|
||||
Pipe_Network.process()
|
||||
continue
|
||||
|
||||
pipe_networks = pipe_networks - Pipe_Network
|
||||
pipe_networks -= Pipe_Network
|
||||
|
||||
/datum/controller/game_controller/proc/processPowernets()
|
||||
last_thing_processed = /datum/powernet
|
||||
@@ -305,7 +305,7 @@ datum/controller/game_controller/proc/processMobs()
|
||||
Powernet.reset()
|
||||
continue
|
||||
|
||||
powernets = powernets - Powernet
|
||||
powernets -= Powernet
|
||||
|
||||
/datum/controller/game_controller/proc/processNano()
|
||||
for (var/datum/nanoui/Nanoui in nanomanager.processing_uis)
|
||||
@@ -313,7 +313,7 @@ datum/controller/game_controller/proc/processMobs()
|
||||
Nanoui.process()
|
||||
continue
|
||||
|
||||
nanomanager.processing_uis = nanomanager.processing_uis - Nanoui
|
||||
nanomanager.processing_uis -= Nanoui
|
||||
|
||||
/datum/controller/game_controller/proc/processEvents()
|
||||
last_thing_processed = /datum/event
|
||||
@@ -323,7 +323,7 @@ datum/controller/game_controller/proc/processMobs()
|
||||
Event.process()
|
||||
continue
|
||||
|
||||
events = events - Event
|
||||
events -= Event
|
||||
|
||||
checkEvent()
|
||||
|
||||
|
||||
@@ -54,7 +54,13 @@ var/global/list/bad_blocks[0]
|
||||
|
||||
// Skip checking if it's already active.
|
||||
// Used for genes that check for value rather than a binary on/off.
|
||||
#define GENE_ALWAYS_ACTIVATE 1
|
||||
#define GENE_ALWAYS_ACTIVATE 1
|
||||
|
||||
// One of the genes that can't be handed out at roundstart
|
||||
#define GENE_UNNATURAL 2
|
||||
|
||||
#define GENETYPE_BAD 0
|
||||
#define GENETYPE_GOOD 1
|
||||
|
||||
/datum/dna
|
||||
// READ-ONLY, GETS OVERWRITTEN
|
||||
@@ -97,6 +103,9 @@ var/global/list/bad_blocks[0]
|
||||
new_dna.UpdateSE()
|
||||
return new_dna
|
||||
|
||||
/datum/dna/proc/GiveRandomSE(var/notflags = 0, var/flags = 0, var/genetype = -1)
|
||||
SetSEState(pick(query_genes(notflags,flags,genetype)), 1)
|
||||
|
||||
///////////////////////////////////////
|
||||
// UNIQUE IDENTITY
|
||||
///////////////////////////////////////
|
||||
|
||||
@@ -170,3 +170,13 @@
|
||||
// Used below, simple injection modifier.
|
||||
/proc/probinj(var/pr, var/inj)
|
||||
return prob(pr+inj*pr)
|
||||
|
||||
|
||||
/proc/query_genes(var/notflags = 0, var/flags = 0, var/genetype = -1)
|
||||
. = list()
|
||||
for(var/datum/dna/gene/gene in dna_genes)
|
||||
if(!gene.block) continue
|
||||
if(genetype>-1 && gene.genetype!=genetype) continue
|
||||
if(flags!=0 && !(gene.flags & flags)) continue
|
||||
if(notflags!=0 && (gene.flags & notflags)) continue
|
||||
. += gene.block
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
/datum/dna/gene/disability
|
||||
name="DISABILITY"
|
||||
genetype = GENETYPE_BAD
|
||||
|
||||
// Mutation to give (or 0)
|
||||
var/mutation=0
|
||||
@@ -83,6 +84,7 @@
|
||||
activation_message="You feel lightheaded."
|
||||
deactivation_message = "You no longer feel lightheaded."
|
||||
mutation=M_CLUMSY
|
||||
flags = GENE_UNNATURAL // Clown-specific.
|
||||
|
||||
New()
|
||||
block=CLUMSYBLOCK
|
||||
@@ -92,6 +94,7 @@
|
||||
activation_message="You twitch."
|
||||
deactivation_message = "You stop twitching."
|
||||
disability=TOURETTES
|
||||
flags = GENE_UNNATURAL // Game-wrecking
|
||||
|
||||
New()
|
||||
block=TWITCHBLOCK
|
||||
@@ -110,6 +113,7 @@
|
||||
activation_message="You can't seem to see anything."
|
||||
deactivation_message = "You can see again."
|
||||
sdisability=BLIND
|
||||
flags = GENE_UNNATURAL
|
||||
|
||||
New()
|
||||
block=BLINDBLOCK
|
||||
@@ -119,6 +123,7 @@
|
||||
activation_message="It's kinda quiet."
|
||||
deactivation_message = "You can hear again."
|
||||
sdisability=DEAF
|
||||
flags = GENE_UNNATURAL
|
||||
|
||||
New()
|
||||
block=DEAFBLOCK
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
// Any of a number of GENE_ flags.
|
||||
var/flags=0
|
||||
|
||||
var/genetype = GENETYPE_BAD
|
||||
|
||||
/**
|
||||
* Is the gene active in this mob's DNA?
|
||||
*/
|
||||
@@ -89,7 +91,8 @@
|
||||
|
||||
|
||||
/datum/dna/gene/basic
|
||||
name="BASIC GENE"
|
||||
name = "BASIC GENE"
|
||||
genetype = GENETYPE_GOOD
|
||||
|
||||
// Mutation to give
|
||||
var/mutation=0
|
||||
@@ -103,6 +106,7 @@
|
||||
// Possible deactivation messages
|
||||
var/list/deactivation_messages=list()
|
||||
|
||||
|
||||
/datum/dna/gene/basic/can_activate(var/mob/M,var/flags)
|
||||
if(flags & MUTCHK_FORCED)
|
||||
return 1
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
desc = "The subject suffers from constant radiation sickness and causes the same on nearby organics."
|
||||
activation_message = "You feel a strange sickness permeate your whole body."
|
||||
deactivation_message = "You no longer feel awful and sick all over."
|
||||
flags = GENE_UNNATURAL
|
||||
|
||||
New()
|
||||
..()
|
||||
@@ -216,6 +217,7 @@
|
||||
desc = "Causes the subject's digestion to create a significant amount of noxious gas."
|
||||
activation_message = "Your stomach grumbles unpleasantly."
|
||||
deactivation_message = "Your stomach stops acting up. Phew!"
|
||||
flags = GENE_UNNATURAL
|
||||
|
||||
mutation = M_TOXIC_FARTS
|
||||
|
||||
@@ -247,6 +249,7 @@
|
||||
desc = "Enables the growth of a compacted keratin formation on the subject's head."
|
||||
activation_message = "A pair of horns erupt from your head."
|
||||
deactivation_message = "Your horns crumble away into nothing."
|
||||
flags = GENE_UNNATURAL
|
||||
|
||||
New()
|
||||
..()
|
||||
@@ -289,6 +292,7 @@
|
||||
/datum/dna/gene/basic/grant_spell/immolate
|
||||
name = "Incendiary Mitochondria"
|
||||
desc = "The subject becomes able to convert excess cellular energy into thermal energy."
|
||||
flags = GENE_UNNATURAL
|
||||
activation_messages = list("You suddenly feel rather hot.")
|
||||
deactivation_messages = list("You no longer feel uncomfortably hot.")
|
||||
|
||||
@@ -329,6 +333,7 @@
|
||||
/datum/dna/gene/basic/grant_verb/melt
|
||||
name = "Self Biomass Manipulation"
|
||||
desc = "The subject becomes able to transform the matter of their cells into a liquid state."
|
||||
flags = GENE_UNNATURAL
|
||||
activation_messages = list("You feel strange and jiggly.")
|
||||
deactivation_messages = list("You feel more solid.")
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/datum/dna/gene/monkey
|
||||
name="Monkey"
|
||||
flags = GENE_UNNATURAL
|
||||
|
||||
/datum/dna/gene/monkey/New()
|
||||
block=MONKEYBLOCK
|
||||
|
||||
@@ -8,14 +8,15 @@ Obviously, requires DNA2.
|
||||
/mob/living/carbon/human/var/hulk_time=0
|
||||
|
||||
// In decaseconds.
|
||||
#define HULK_DURATION 300
|
||||
#define HULK_COOLDOWN 600
|
||||
#define HULK_DURATION 300 // How long the effects last
|
||||
#define HULK_COOLDOWN 600 // How long they must wait to hulk out.
|
||||
|
||||
/datum/dna/gene/basic/grant_spell/hulk
|
||||
name = "Hulk"
|
||||
desc = "Allows the subject to become the motherfucking Hulk."
|
||||
activation_messages = list("Your muscles hurt.")
|
||||
deactivation_messages = list("Your muscles quit tensing.")
|
||||
flags = GENE_UNNATURAL // Do NOT spawn on roundstart.
|
||||
|
||||
spelltype = /obj/effect/proc_holder/spell/targeted/hulk
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
else if(!player.mind.assigned_role)
|
||||
continue
|
||||
else
|
||||
player.create_character()
|
||||
player.FuckUpGenes(player.create_character())
|
||||
del(player)
|
||||
|
||||
|
||||
|
||||
@@ -113,16 +113,31 @@ Class Procs:
|
||||
var/global/gl_uid = 1
|
||||
var/custom_aghost_alerts=0
|
||||
var/panel_open = 0
|
||||
var/myArea
|
||||
|
||||
/obj/machinery/New()
|
||||
..()
|
||||
addAtProcessing()
|
||||
return ..()
|
||||
|
||||
/obj/machinery/proc/addAtProcessing()
|
||||
if (use_power)
|
||||
myArea = loc.loc
|
||||
|
||||
machines += src
|
||||
|
||||
/obj/machinery/Destroy()
|
||||
/obj/machinery/proc/removeAtProcessing()
|
||||
if (myArea)
|
||||
myArea = null
|
||||
|
||||
machines -= src
|
||||
|
||||
/obj/machinery/Destroy()
|
||||
if (src in machines)
|
||||
removeAtProcessing()
|
||||
|
||||
..()
|
||||
|
||||
/obj/machinery/process()//If you dont use process or power why are you here
|
||||
/obj/machinery/process() // If you dont use process or power why are you here
|
||||
return PROCESS_KILL
|
||||
|
||||
/obj/machinery/emp_act(severity)
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
desc = "A card used to provide ID and determine access across the station."
|
||||
icon_state = "id"
|
||||
item_state = "card-id"
|
||||
var/mining_points = 0 //For redeeming at mining equipment lockers
|
||||
var/access = list()
|
||||
var/registered_name = "Unknown" // The name registered_name on the card
|
||||
slot_flags = SLOT_ID
|
||||
@@ -92,8 +91,6 @@
|
||||
/obj/item/weapon/card/id/attack_self(mob/user as mob)
|
||||
for(var/mob/O in viewers(user, null))
|
||||
O.show_message(text("[] shows you: \icon[] []: assignment: []", user, src, src.name, src.assignment), 1)
|
||||
if(mining_points)
|
||||
user << "There's [mining_points] mining equipment redemption points loaded onto this card."
|
||||
src.add_fingerprint(user)
|
||||
return
|
||||
|
||||
@@ -102,6 +99,15 @@
|
||||
|
||||
/obj/item/weapon/card/id/GetID()
|
||||
return src
|
||||
|
||||
/obj/item/weapon/card/id/proc/GetBalance(var/format=0)
|
||||
var/amt = 0
|
||||
var/datum/money_account/acct = get_card_account(src)
|
||||
if(acct)
|
||||
amt = acct.money
|
||||
if(format)
|
||||
amt = "$[num2septext(amt)]"
|
||||
return amt
|
||||
// vgedit: We have different wallets.
|
||||
/*
|
||||
/obj/item/weapon/card/id/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
var/global/list/moneytypes=list(
|
||||
/obj/item/weapon/spacecash/c1000 = 1000,
|
||||
/obj/item/weapon/spacecash/c500 = 500, // Might get rid of this.
|
||||
/obj/item/weapon/spacecash/c100 = 100,
|
||||
/obj/item/weapon/spacecash/c10 = 10,
|
||||
/obj/item/weapon/spacecash = 1,
|
||||
@@ -66,11 +65,6 @@ var/global/list/moneytypes=list(
|
||||
worth = 100
|
||||
stack_color = "#663200"
|
||||
|
||||
/obj/item/weapon/spacecash/c500
|
||||
icon_state = "cash500"
|
||||
worth = 500
|
||||
stack_color = "#663200"
|
||||
|
||||
/obj/item/weapon/spacecash/c1000
|
||||
icon_state = "cash1000"
|
||||
worth = 1000
|
||||
|
||||
@@ -77,14 +77,12 @@
|
||||
var/item1_type = pick(/obj/item/weapon/spacecash,
|
||||
/obj/item/weapon/spacecash/c10,
|
||||
/obj/item/weapon/spacecash/c100,
|
||||
/obj/item/weapon/spacecash/c500,
|
||||
/obj/item/weapon/spacecash/c1000)
|
||||
var/item2_type
|
||||
if(prob(50))
|
||||
item2_type = pick(/obj/item/weapon/spacecash,
|
||||
/obj/item/weapon/spacecash/c10,
|
||||
/obj/item/weapon/spacecash/c100,
|
||||
/obj/item/weapon/spacecash/c500,
|
||||
/obj/item/weapon/spacecash/c1000)
|
||||
var/item3_type = pick( /obj/item/weapon/coin/silver, /obj/item/weapon/coin/silver, /obj/item/weapon/coin/gold, /obj/item/weapon/coin/iron, /obj/item/weapon/coin/iron, /obj/item/weapon/coin/iron )
|
||||
|
||||
|
||||
71
code/modules/Economy/utils.dm
Normal file
71
code/modules/Economy/utils.dm
Normal file
@@ -0,0 +1,71 @@
|
||||
////////////////////////
|
||||
// Ease-of-use
|
||||
//
|
||||
// Economy system is such a mess of spaghetti. This should help.
|
||||
////////////////////////
|
||||
|
||||
/proc/get_money_account(var/account_number, var/pin=0, var/security_level = 0, var/pin_needed=1, var/from_z=-1)
|
||||
for(var/obj/machinery/account_database/DB in machines)
|
||||
if(from_z != -1 && DB.z != from_z) continue
|
||||
if((DB.stat & NOPOWER) || !DB.activated ) continue
|
||||
var/datum/money_account/acct = DB.get_account(account_number,pin,security_level,pin_needed,from_z)
|
||||
if(!acct) continue
|
||||
return acct
|
||||
|
||||
|
||||
/obj/proc/get_card_account(var/obj/item/weapon/card/I, var/terminal_name="", var/transaction_purpose="", var/require_pin=0)
|
||||
if(terminal_name=="")
|
||||
terminal_name=src.name
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
var/obj/item/weapon/card/id/C = I
|
||||
var/seclevel=0
|
||||
var/attempt_pin=0
|
||||
if(require_pin)
|
||||
attempt_pin = input("Enter pin code", "Transaction") as num
|
||||
seclevel=2
|
||||
var/datum/money_account/D = get_money_account(C.associated_account_number, pin=attempt_pin, security_level=seclevel)
|
||||
if(D)
|
||||
return D
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>Unable to access account. Check security settings and try again.</span>"
|
||||
|
||||
/datum/money_account/proc/charge(var/transaction_amount,var/datum/money_account/dest,var/transaction_purpose, var/terminal_name="", var/terminal_id=0)
|
||||
if(transaction_amount <= money)
|
||||
//transfer the money
|
||||
money -= transaction_amount
|
||||
if(dest)
|
||||
dest.money += transaction_amount
|
||||
|
||||
//create entries in the two account transaction logs
|
||||
var/datum/transaction/T
|
||||
if(dest)
|
||||
T = new()
|
||||
T.target_name = "[owner_name]"
|
||||
if(terminal_name!="")
|
||||
T.target_name += " (via [terminal_name])"
|
||||
T.purpose = transaction_purpose
|
||||
if(transaction_amount > 0)
|
||||
T.amount = "([transaction_amount])"
|
||||
else
|
||||
T.amount = "[transaction_amount]"
|
||||
if(terminal_id)
|
||||
T.source_terminal = terminal_id
|
||||
T.date = current_date_string
|
||||
T.time = worldtime2text()
|
||||
dest.transaction_log.Add(T)
|
||||
//
|
||||
T = new()
|
||||
T.target_name = dest.owner_name
|
||||
if(terminal_name!="")
|
||||
T.target_name += " (via [terminal_name])"
|
||||
T.purpose = transaction_purpose
|
||||
T.amount = "[transaction_amount]"
|
||||
if(terminal_id)
|
||||
T.source_terminal = terminal_id
|
||||
T.date = current_date_string
|
||||
T.time = worldtime2text()
|
||||
transaction_log.Add(T)
|
||||
return 1
|
||||
else
|
||||
usr << "\icon[src]<span class='warning'>You don't have that much money!</span>"
|
||||
return 0
|
||||
@@ -21,7 +21,7 @@
|
||||
var/datum/materials/materials = new
|
||||
var/stack_amt = 50 //amount to stack before releasing
|
||||
var/obj/item/weapon/card/id/inserted_id
|
||||
var/points = 0
|
||||
var/credits = 0
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/initialize()
|
||||
for (var/dir in cardinal)
|
||||
@@ -44,7 +44,7 @@
|
||||
if(processed_sheet)
|
||||
var/datum/material/mat = materials.getMaterial(O.material)
|
||||
mat.stored += processed_sheet.amount //Stack the sheets
|
||||
points += mat.value * processed_sheet.amount // Gimme my fucking points
|
||||
credits += mat.value * processed_sheet.amount // Gimme my fucking credits
|
||||
qdel(O)
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/process()
|
||||
@@ -64,14 +64,14 @@
|
||||
for(var/mat_id in B.materials.storage)
|
||||
var/datum/material/mat = B.materials.getMaterial(mat_id)
|
||||
materials.addAmount(mat_id,mat.stored)
|
||||
points += mat.value * mat.stored // Gimme my fucking points
|
||||
credits += mat.value * mat.stored // Gimme my fucking credits
|
||||
mat.stored=0
|
||||
|
||||
/obj/machinery/mineral/ore_redemption/proc/SmeltMineral(var/obj/item/weapon/ore/O)
|
||||
if(O.material)
|
||||
var/datum/material/mat = materials.getMaterial(O.material)
|
||||
var/obj/item/stack/sheet/M = new mat.sheettype(src)
|
||||
//points += mat.value // Old behavior
|
||||
//credits += mat.value // Old behavior
|
||||
return M
|
||||
del(O)//No refined type? Purge it.
|
||||
return
|
||||
@@ -86,10 +86,10 @@
|
||||
|
||||
dat += text("<b>Ore Redemption Machine</b><br><br>")
|
||||
dat += text("This machine only accepts ore. Gibtonite and Slag are not accepted.<br><br>")
|
||||
dat += text("Current unclaimed points: [points]<br>")
|
||||
dat += text("Current unclaimed credits: $[num2septext(credits)]<br>")
|
||||
|
||||
if(istype(inserted_id))
|
||||
dat += text("You have [inserted_id.mining_points] mining points collected. <A href='?src=\ref[src];choice=eject'>Eject ID.</A><br>")
|
||||
dat += "You have [inserted_id.GetBalance(format=1)] credits in your bank account. <A href='?src=\ref[src];choice=eject'>Eject ID.</A><br>"
|
||||
dat += text("<A href='?src=\ref[src];choice=claim'>Claim points.</A><br>")
|
||||
else
|
||||
dat += text("No ID inserted. <A href='?src=\ref[src];choice=insert'>Insert ID.</A><br>")
|
||||
@@ -126,9 +126,12 @@
|
||||
inserted_id.verb_pickup()
|
||||
inserted_id = null
|
||||
if(href_list["choice"] == "claim")
|
||||
inserted_id.mining_points += points
|
||||
points = 0
|
||||
src << "Points transferred."
|
||||
var/datum/money_account/acct = get_card_account(inserted_id)
|
||||
if(acct.charge(-credits,null,"Claimed mining credits."))
|
||||
credits = 0
|
||||
usr << "\blue Credits transferred."
|
||||
else
|
||||
usr << "\red Failed to claim credits."
|
||||
else if(href_list["choice"] == "insert")
|
||||
var/obj/item/weapon/card/id/I = usr.get_active_hand()
|
||||
if(istype(I))
|
||||
@@ -177,7 +180,6 @@
|
||||
//new /datum/data/mining_equipment("Laser pointer", /obj/item/device/laser_pointer, 250),
|
||||
new /datum/data/mining_equipment("Point card", /obj/item/weapon/card/mining_point_card, 500),
|
||||
new /datum/data/mining_equipment("Lazarus injector", /obj/item/weapon/lazarus_injector, 1000),
|
||||
new /datum/data/mining_equipment("Space cash", /obj/item/weapon/spacecash/c1000, 5000),
|
||||
new /datum/data/mining_equipment("Sonic jackhammer", /obj/item/weapon/pickaxe/jackhammer, 500),
|
||||
new /datum/data/mining_equipment("Mining drone", /mob/living/simple_animal/hostile/mining_drone/, 500),
|
||||
new /datum/data/mining_equipment("Jaunter", /obj/item/device/wormhole_jaunter, 250),
|
||||
@@ -185,6 +187,7 @@
|
||||
new /datum/data/mining_equipment("Kinetic accelerator", /obj/item/weapon/gun/energy/kinetic_accelerator, 1000),
|
||||
new /datum/data/mining_equipment("Jetpack", /obj/item/weapon/tank/jetpack/carbondioxide, 2000),
|
||||
)
|
||||
var/datum/money_account/linked_account // Department account.
|
||||
|
||||
/datum/data/mining_equipment/
|
||||
var/equipment_name = "generic"
|
||||
@@ -199,6 +202,8 @@
|
||||
/obj/machinery/mineral/equipment_locker/attack_hand(user as mob)
|
||||
if(..())
|
||||
return
|
||||
if(!linked_account)
|
||||
linked_account = department_accounts["Cargo"]
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/mineral/equipment_locker/interact(mob/user)
|
||||
@@ -206,7 +211,16 @@
|
||||
dat += text("<b>Mining Equipment Locker</b><br><br>")
|
||||
|
||||
if(istype(inserted_id))
|
||||
dat += "You have [inserted_id.mining_points] mining points collected. <A href='?src=\ref[src];choice=eject'>Eject ID.</A><br>"
|
||||
dat += "You have [inserted_id.GetBalance(format=1)] in your account. <A href='?src=\ref[src];choice=eject'>Eject ID.</A><br />"
|
||||
if(access_qm in inserted_id.GetAccess())
|
||||
dat += "Pays to: <a href='?src=\ref[src];choice=link'>"
|
||||
if(linked_account == station_account)
|
||||
dat += "Station Account"
|
||||
else if(linked_account == department_accounts["Cargo"])
|
||||
dat += "Cargo Account"
|
||||
else
|
||||
dat += "Personal Account"
|
||||
dat += "</a><br />"
|
||||
else
|
||||
dat += "No ID inserted. <A href='?src=\ref[src];choice=insert'>Insert ID.</A><br>"
|
||||
|
||||
@@ -241,10 +255,20 @@
|
||||
var/datum/data/mining_equipment/prize = locate(href_list["purchase"])
|
||||
if (!prize || !(prize in prize_list))
|
||||
return 1
|
||||
if(prize.cost > inserted_id.mining_points)
|
||||
else
|
||||
inserted_id.mining_points -= prize.cost
|
||||
new prize.equipment_path(src.loc)
|
||||
var/balance=inserted_id.GetBalance()
|
||||
if(prize.cost <= balance)
|
||||
var/datum/money_account/acct = get_card_account(inserted_id,require_pin=1)
|
||||
if(acct.charge(prize.cost,linked_account,"Purchased [prize.name]"))
|
||||
new prize.equipment_path(src.loc)
|
||||
if(href_list["link"])
|
||||
if(istype(inserted_id))
|
||||
if(access_qm in inserted_id.GetAccess())
|
||||
if(linked_account == station_account)
|
||||
linked_account = department_accounts["Cargo"]
|
||||
else if(linked_account == department_accounts["Cargo"])
|
||||
linked_account = get_card_account(inserted_id)
|
||||
else
|
||||
linked_account = station_account
|
||||
updateUsrDialog()
|
||||
return
|
||||
|
||||
@@ -293,8 +317,8 @@
|
||||
/**********************Mining Point Card**********************/
|
||||
|
||||
/obj/item/weapon/card/mining_point_card
|
||||
name = "mining point card"
|
||||
desc = "A small card preloaded with mining points. Swipe your ID card over it to transfer the points, then discard."
|
||||
name = "gift card"
|
||||
desc = "A small card preloaded with credits. Swipe your ID card over it to transfer the credits, then discard."
|
||||
icon_state = "data"
|
||||
var/points = 500
|
||||
|
||||
@@ -302,16 +326,19 @@
|
||||
if(istype(I, /obj/item/weapon/card/id))
|
||||
if(points)
|
||||
var/obj/item/weapon/card/id/C = I
|
||||
C.mining_points += points
|
||||
user << "<span class='info'>You transfer [points] points to [C].</span>"
|
||||
points = 0
|
||||
var/datum/money_account/acct = get_card_account(I)
|
||||
if(acct.charge(-points,null,"Redeemed gift card."))
|
||||
user << "<span class='info'>You transfer [points] credits to [C].</span>"
|
||||
points = 0
|
||||
else
|
||||
user << "<span class='warning'>Unable to transfer credits.</span>"
|
||||
else
|
||||
user << "<span class='info'>There's no points left on [src].</span>"
|
||||
..()
|
||||
|
||||
/obj/item/weapon/card/mining_point_card/examine()
|
||||
..()
|
||||
usr << "There's [points] points on the card."
|
||||
usr << "There's [points] credits on the card."
|
||||
|
||||
/**********************Jaunter**********************/
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
fluffitems = list(
|
||||
/obj/structure/table/woodentable=2,
|
||||
/obj/structure/reagent_dispensers/beerkeg=1,
|
||||
/obj/item/weapon/spacecash/c500=4,
|
||||
/obj/item/weapon/spacecash/c1000=2,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/shaker=1,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/bottle/wine=3,
|
||||
/obj/item/weapon/reagent_containers/food/drinks/bottle/whiskey=3,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
switch(act)
|
||||
if ("help")
|
||||
src << "Available emotes: aflap, bow, clap, custom, flap, twitch, twitch_s, salute, nod, deathgasp, me, glare, stare, beep, ping, buzz, look"
|
||||
src << "Available emotes: aflap, bow, clap, custom, flap, twitch, twitch_s, salute, nod, deathgasp, me, glare, stare, shrug, beep, ping, buzz, look"
|
||||
return
|
||||
if ("salute")
|
||||
//if (!src.buckled)
|
||||
@@ -44,6 +44,21 @@
|
||||
else
|
||||
message = "<B>[src]</B> bows."
|
||||
m_type = 1
|
||||
if ("shrug")
|
||||
var/M = null
|
||||
if (param)
|
||||
for (var/mob/A in view(null, null))
|
||||
if (param == A.name)
|
||||
M = A
|
||||
break
|
||||
if (!M)
|
||||
param = null
|
||||
|
||||
if (param)
|
||||
message = "<B>[src]</B> shrugs at [param]."
|
||||
else
|
||||
message = "<B>[src]</B> shrugs."
|
||||
m_type = 1
|
||||
|
||||
if ("clap")
|
||||
if (!src.restrained())
|
||||
|
||||
@@ -290,6 +290,13 @@
|
||||
return 0
|
||||
return 1
|
||||
|
||||
proc/FuckUpGenes(var/mob/living/carbon/human/H)
|
||||
// 20% of players have bad genetic mutations.
|
||||
if(prob(20))
|
||||
H.dna.GiveRandomSE(notflags = GENE_UNNATURAL,genetype = GENETYPE_BAD)
|
||||
if(prob(10)) // 10% of those have a good mut.
|
||||
H.dna.GiveRandomSE(notflags = GENE_UNNATURAL,genetype = GENETYPE_GOOD)
|
||||
|
||||
|
||||
proc/AttemptLateSpawn(rank)
|
||||
if (src != usr)
|
||||
@@ -320,7 +327,7 @@
|
||||
data_core.manifest_inject(character)
|
||||
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn
|
||||
AnnounceArrival(character, rank)
|
||||
|
||||
FuckUpGenes(character)
|
||||
else
|
||||
character.Robotize()
|
||||
del(src)
|
||||
|
||||
@@ -55,12 +55,20 @@
|
||||
// increment the power usage stats for an area
|
||||
|
||||
/obj/machinery/proc/use_power(var/amount, var/chan = -1) // defaults to power_channel
|
||||
var/area/A = get_area(src) // make sure it's in an area
|
||||
if(!A || !isarea(A) || !A.master)
|
||||
var/A = getArea()
|
||||
|
||||
if(!A || !isarea(A))
|
||||
return
|
||||
if(chan == -1)
|
||||
|
||||
var/area/B = A
|
||||
|
||||
if (!B.master)
|
||||
return
|
||||
|
||||
if (-1 == chan)
|
||||
chan = power_channel
|
||||
A.master.use_power(amount, chan)
|
||||
|
||||
B.master.use_power(amount, chan)
|
||||
|
||||
/obj/machinery/proc/power_change() // called whenever the power settings of the containing area change
|
||||
// by default, check equipment channel & set flag
|
||||
|
||||
Reference in New Issue
Block a user