mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into intercom
Conflicts: code/modules/projectiles/guns/projectile/automatic.dm icons/mob/back.dmi
This commit is contained in:
@@ -48,10 +48,10 @@
|
||||
if(amt > 0 && has_space(amt))
|
||||
var/total_amount_saved = total_amount
|
||||
if(material_type)
|
||||
for(var/datum/material/M in materials)
|
||||
if(M.material_type == material_type)
|
||||
M.amount += amt
|
||||
total_amount += amt
|
||||
var/datum/material/M = materials[material_type]
|
||||
if(M)
|
||||
M.amount += amt
|
||||
total_amount += amt
|
||||
else
|
||||
for(var/datum/material/M in materials)
|
||||
M.amount += amt
|
||||
@@ -60,9 +60,14 @@
|
||||
return 0
|
||||
|
||||
/datum/material_container/proc/insert_stack(obj/item/stack/S, amt = 0)
|
||||
if(!amt)
|
||||
if(amt <= 0)
|
||||
return 0
|
||||
if(amt > S.amount)
|
||||
amt = S.amount
|
||||
var/material_amt = get_item_material_amount(S)
|
||||
if(!material_amt)
|
||||
return 0
|
||||
|
||||
amt = min(amt, round(((max_amount - total_amount) / material_amt)))
|
||||
if(!amt)
|
||||
return 0
|
||||
@@ -75,7 +80,8 @@
|
||||
if(!I)
|
||||
return 0
|
||||
if(istype(I,/obj/item/stack))
|
||||
return insert_stack(I)
|
||||
var/obj/item/stack/S = I
|
||||
return insert_stack(I, S.amount)
|
||||
|
||||
var/material_amount = get_item_material_amount(I)
|
||||
if(!material_amount || !has_space(material_amount))
|
||||
@@ -93,21 +99,21 @@
|
||||
|
||||
//For consuming material
|
||||
//mats is a list of types of material to use and the corresponding amounts, example: list(MAT_METAL=100, MAT_GLASS=200)
|
||||
/datum/material_container/proc/use_amount(list/mats)
|
||||
/datum/material_container/proc/use_amount(list/mats, multiplier=1)
|
||||
if(!mats || !mats.len)
|
||||
return 0
|
||||
|
||||
var/datum/material/M
|
||||
for(var/MAT in materials)
|
||||
M = materials[MAT]
|
||||
if(M.amount < mats[MAT])
|
||||
if(M.amount < (mats[MAT] * multiplier))
|
||||
return 0
|
||||
|
||||
var/total_amount_save = total_amount
|
||||
for(var/MAT in materials)
|
||||
M = materials[MAT]
|
||||
M.amount -= mats[MAT]
|
||||
total_amount -= mats[MAT]
|
||||
M.amount -= mats[MAT] * multiplier
|
||||
total_amount -= mats[MAT] * multiplier
|
||||
|
||||
return total_amount_save - total_amount
|
||||
|
||||
@@ -124,7 +130,9 @@
|
||||
|
||||
//For spawning mineral sheets; internal use only
|
||||
/datum/material_container/proc/retrieve(sheet_amt, datum/material/M)
|
||||
if(sheet_amt > 0 && M.amount >= (sheet_amt * MINERAL_MATERIAL_AMOUNT))
|
||||
if(sheet_amt > 0)
|
||||
if(M.amount < (sheet_amt * MINERAL_MATERIAL_AMOUNT))
|
||||
sheet_amt = round(M.amount / MINERAL_MATERIAL_AMOUNT)
|
||||
var/count = 0
|
||||
|
||||
while(sheet_amt > MAX_STACK_SIZE)
|
||||
@@ -159,6 +167,17 @@
|
||||
/datum/material_container/proc/has_space(amt = 0)
|
||||
return (total_amount + amt) <= max_amount
|
||||
|
||||
/datum/material_container/proc/has_materials(list/mats, multiplier=1)
|
||||
if(!mats || !mats.len)
|
||||
return 0
|
||||
|
||||
var/datum/material/M
|
||||
for(var/MAT in mats)
|
||||
M = materials[MAT]
|
||||
if(M.amount < (mats[MAT] * multiplier))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/datum/material_container/proc/amount2sheet(amt)
|
||||
if(amt >= MINERAL_MATERIAL_AMOUNT)
|
||||
return round(amt / MINERAL_MATERIAL_AMOUNT)
|
||||
@@ -173,9 +192,6 @@
|
||||
var/datum/material/M = materials[material_type]
|
||||
return M ? M.amount : 0
|
||||
|
||||
/datum/material_container/proc/can_insert(obj/item/I)
|
||||
return get_item_material_amount(I)
|
||||
|
||||
//returns the amount of material relevant to this container;
|
||||
//if this container does not support glass, any glass in 'I' will not be taken into account
|
||||
/datum/material_container/proc/get_item_material_amount(obj/item/I)
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
cooldown_min = 30
|
||||
selection_type = "view"
|
||||
random_target = 1
|
||||
var/energy = 0
|
||||
var/start_time = 0
|
||||
var/ready = 0
|
||||
var/image/halo = null
|
||||
action_icon_state = "lightning"
|
||||
@@ -20,11 +20,11 @@
|
||||
invocation_type = "none"
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/lightning/Click()
|
||||
if(!ready)
|
||||
if(!ready && start_time==0)
|
||||
if(cast_check())
|
||||
StartChargeup()
|
||||
else
|
||||
if(cast_check(skipcharge=1))
|
||||
if(ready && cast_check(skipcharge=1))
|
||||
choose_targets()
|
||||
return 1
|
||||
|
||||
@@ -33,16 +33,14 @@
|
||||
user << "<span class='notice'>You start gathering the power.</span>"
|
||||
halo = image("icon"='icons/effects/effects.dmi',"icon_state" ="electricity","layer" = EFFECTS_LAYER)
|
||||
user.overlays.Add(halo)
|
||||
spawn(0)
|
||||
while(ready)
|
||||
sleep(1)
|
||||
energy++
|
||||
if(energy >= 100 && ready)
|
||||
Discharge()
|
||||
start_time = world.time
|
||||
if(do_mob(user,user,100,uninterruptible=1))
|
||||
if(ready)
|
||||
Discharge()
|
||||
|
||||
obj/effect/proc_holder/spell/targeted/lightning/proc/Reset(mob/user = usr)
|
||||
ready = 0
|
||||
energy = 0
|
||||
start_time = 0
|
||||
if(halo)
|
||||
user.overlays.Remove(halo)
|
||||
|
||||
@@ -53,16 +51,14 @@ obj/effect/proc_holder/spell/targeted/lightning/proc/Reset(mob/user = usr)
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/lightning/proc/Discharge(mob/user = usr)
|
||||
var/mob/living/M = user
|
||||
//M.electrocute_act(25,"Lightning Bolt")
|
||||
M << "<span class='danger'>You lose control over the spell.</span>"
|
||||
Reset(user)
|
||||
start_recharge()
|
||||
|
||||
|
||||
/obj/effect/proc_holder/spell/targeted/lightning/cast(list/targets, mob/user = usr)
|
||||
|
||||
ready = 0
|
||||
var/mob/living/carbon/target = targets[1]
|
||||
|
||||
if(get_dist(user,target)>range)
|
||||
user << "<span class='notice'>They are too far away!</span>"
|
||||
Reset(user)
|
||||
@@ -70,6 +66,7 @@ obj/effect/proc_holder/spell/targeted/lightning/proc/Reset(mob/user = usr)
|
||||
|
||||
user.Beam(target,icon_state="lightning",icon='icons/effects/effects.dmi',time=5)
|
||||
|
||||
var/energy = min(world.time - start_time,100)
|
||||
Bolt(user,target,max(15,energy/2),5,user) //5 bounces for energy/2 burn
|
||||
Reset(user)
|
||||
|
||||
|
||||
+14
-15
@@ -217,7 +217,6 @@ var/list/uplink_items = list()
|
||||
cost = 12
|
||||
job = list("Research Director")
|
||||
|
||||
|
||||
//Stimulants
|
||||
|
||||
/datum/uplink_item/jobspecific/stims
|
||||
@@ -245,14 +244,14 @@ var/list/uplink_items = list()
|
||||
|
||||
|
||||
/datum/uplink_item/dangerous/pistol
|
||||
name = "Syndicate Pistol"
|
||||
name = "FK-69 Pistol"
|
||||
reference = "SPI"
|
||||
desc = "A small, easily concealable handgun that uses 10mm auto rounds in 8-round magazines and is compatible with suppressors."
|
||||
item = /obj/item/weapon/gun/projectile/automatic/pistol
|
||||
cost = 9
|
||||
|
||||
/datum/uplink_item/dangerous/revolver
|
||||
name = "Syndicate Revolver"
|
||||
name = "Syndicate .357 Revolver"
|
||||
reference = "SR"
|
||||
desc = "A brutally simple syndicate revolver that fires .357 Magnum cartridges and has 7 chambers."
|
||||
item = /obj/item/weapon/gun/projectile/revolver
|
||||
@@ -260,7 +259,7 @@ var/list/uplink_items = list()
|
||||
surplus = 50
|
||||
|
||||
/datum/uplink_item/dangerous/smg
|
||||
name = "Syndicate SMG"
|
||||
name = "C-20r Submachine Gun"
|
||||
reference = "SMG"
|
||||
desc = "A fully-loaded Scarborough Arms bullpup submachine gun that fires .45 rounds with a 20-round magazine and is compatible with suppressors."
|
||||
item = /obj/item/weapon/gun/projectile/automatic/c20r
|
||||
@@ -268,17 +267,17 @@ var/list/uplink_items = list()
|
||||
gamemodes = list("nuclear emergency")
|
||||
surplus = 40
|
||||
|
||||
/datum/uplink_item/dangerous/car
|
||||
name = "C-90gl Compact Assault Rifle"
|
||||
desc = "A fully-loaded Zashchita Industriya toploading bullpup assault rifle that uses 30-round 5.45x39mm magazines with a toggleable underslung 40mm grenade launcher."
|
||||
/datum/uplink_item/dangerous/carbine
|
||||
name = "M-90gl Carbine"
|
||||
desc = "A fully-loaded three-round burst carbine that uses 30-round 5.56mm magazines with a togglable underslung 40mm grenade launcher."
|
||||
reference = "AR"
|
||||
item = /obj/item/weapon/gun/projectile/automatic/c90gl
|
||||
item = /obj/item/weapon/gun/projectile/automatic/m90
|
||||
cost = 18
|
||||
gamemodes = list("nuclear emergency")
|
||||
surplus = 50
|
||||
|
||||
/datum/uplink_item/dangerous/machinegun
|
||||
name = "Syndicate LMG"
|
||||
name = "L6 Squad Automatic Weapon"
|
||||
desc = "A fully-loaded Aussec Armoury belt-fed machine gun. This deadly weapon has a massive 50-round magazine of devastating 7.62x51mm ammunition."
|
||||
reference = "LMG"
|
||||
item = /obj/item/weapon/gun/projectile/automatic/l6_saw
|
||||
@@ -399,7 +398,7 @@ var/list/uplink_items = list()
|
||||
surplus = 40
|
||||
|
||||
/datum/uplink_item/ammo/pistol
|
||||
name = "Ammo-10mm"
|
||||
name = "Magazine - 10mm"
|
||||
desc = "An additional 8-round 10mm magazine for use in the syndicate pistol. These subsonic rounds are dirt cheap but are half as effective as .357 rounds."
|
||||
reference = "10MM"
|
||||
item = /obj/item/ammo_box/magazine/m10mm
|
||||
@@ -460,11 +459,11 @@ var/list/uplink_items = list()
|
||||
cost = 2
|
||||
gamemodes = list("nuclear emergency")
|
||||
|
||||
/datum/uplink_item/ammo/car
|
||||
name = "Box Magazine - 5.45x39mm"
|
||||
desc = "An additional 30-round 5.45x39mm magazine for use in the C-90gl assault rifle. These bullets don't have the punch to knock most targets down, but dish out higher overall damage."
|
||||
reference = "545"
|
||||
item = /obj/item/ammo_box/magazine/m545
|
||||
/datum/uplink_item/ammo/carbine
|
||||
name = "Toploader Magazine - 5.56"
|
||||
desc = "An additional 30-round 5.56 magazine for use in the M-90gl carbine. These bullets don't have the punch to knock most targets down, but dish out higher overall damage."
|
||||
reference = "556"
|
||||
item = /obj/item/ammo_box/magazine/m556
|
||||
cost = 2
|
||||
gamemodes = list("nuclear emergency")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user