Merge pull request #9130 from mwerezak/device-powercell

Adjusts charge cost for energy type guns
This commit is contained in:
Zuhayr
2015-05-12 18:11:39 +09:30
9 changed files with 63 additions and 36 deletions

View File

@@ -22,6 +22,23 @@
viewers(user) << "\red <b>[user] is licking the electrodes of the [src.name]! It looks like \he's trying to commit suicide.</b>" viewers(user) << "\red <b>[user] is licking the electrodes of the [src.name]! It looks like \he's trying to commit suicide.</b>"
return (FIRELOSS) return (FIRELOSS)
//currently only used by energy-type guns, that may change in the future.
/obj/item/weapon/cell/device
name = "device power cell"
desc = "A small power cell designed to power handheld devices."
icon_state = "cell" //placeholder
w_class = 2
force = 0
throw_speed = 5
throw_range = 7
maxcharge = 1000
matter = list("metal" = 350, "glass" = 50)
/obj/item/weapon/cell/device/variable/New(newloc, charge_amount)
..(newloc)
maxcharge = charge_amount
charge = maxcharge
/obj/item/weapon/cell/crap /obj/item/weapon/cell/crap
name = "\improper Nanotrasen brand rechargable AA battery" name = "\improper Nanotrasen brand rechargable AA battery"
desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT

View File

@@ -594,6 +594,8 @@
user << "Close the panel first." user << "Close the panel first."
else if(cell) else if(cell)
user << "There is a power cell already installed." user << "There is a power cell already installed."
else if(W.w_class != 3)
user << "\The [W] is too [W.w_class < 3? "small" : "large"] to fit here."
else else
user.drop_item() user.drop_item()
W.loc = src W.loc = src

View File

@@ -442,18 +442,21 @@
if(cell) if(cell)
user << "There is a power cell already installed." user << "There is a power cell already installed."
return return
else if (stat & MAINT)
if (stat & MAINT) user << "<span class='warning'>There is no connector for your power cell.</span>"
user << "<span class='warning'>There is no connector for your power cell.</span>" return
return if(W.w_class != 3)
user.drop_item() user << "\The [W] is too [W.w_class < 3? "small" : "large"] to fit here."
W.loc = src return
cell = W
user.visible_message(\ user.drop_item()
"<span class='warning'>[user.name] has inserted the power cell to [src.name]!</span>",\ W.loc = src
"<span class='notice'>You insert the power cell.</span>") cell = W
chargecount = 0 user.visible_message(\
update_icon() "<span class='warning'>[user.name] has inserted the power cell to [src.name]!</span>",\
"<span class='notice'>You insert the power cell.</span>")
chargecount = 0
update_icon()
else if (istype(W, /obj/item/weapon/screwdriver)) // haxing else if (istype(W, /obj/item/weapon/screwdriver)) // haxing
if(opened) if(opened)
if (cell) if (cell)

View File

@@ -13,8 +13,9 @@
firemode_type = /datum/firemode/energy firemode_type = /datum/firemode/energy
var/obj/item/weapon/cell/power_supply //What type of power cell this uses var/obj/item/weapon/cell/power_supply //What type of power cell this uses
var/charge_cost = 100 //How much energy is needed to fire. var/charge_cost = 200 //How much energy is needed to fire.
var/cell_type = /obj/item/weapon/cell var/max_shots = 10 //Determines the capacity of the weapon's power cell. Specifying a cell_type overrides this value.
var/cell_type = null
var/projectile_type = /obj/item/projectile/beam/practice var/projectile_type = /obj/item/projectile/beam/practice
var/modifystate var/modifystate
var/charge_meter = 1 //if set, the icon state will be chosen based on the current charge var/charge_meter = 1 //if set, the icon state will be chosen based on the current charge
@@ -45,7 +46,8 @@
..() ..()
if(cell_type) if(cell_type)
power_supply = new cell_type(src) power_supply = new cell_type(src)
power_supply.give(power_supply.maxcharge) else
power_supply = new /obj/item/weapon/cell/device/variable(src, max_shots*charge_cost)
if(self_recharge) if(self_recharge)
processing_objects.Add(src) processing_objects.Add(src)
update_icon() update_icon()

View File

@@ -43,7 +43,7 @@ obj/item/weapon/gun/energy/retro
w_class = 3 w_class = 3
projectile_type = /obj/item/projectile/beam projectile_type = /obj/item/projectile/beam
origin_tech = null origin_tech = null
charge_cost = 200 //to compensate a bit for self-recharging max_shots = 5 //to compensate a bit for self-recharging
self_recharge = 1 self_recharge = 1
/obj/item/weapon/gun/energy/lasercannon /obj/item/weapon/gun/energy/lasercannon
@@ -55,7 +55,8 @@ obj/item/weapon/gun/energy/retro
origin_tech = "combat=4;materials=3;powerstorage=3" origin_tech = "combat=4;materials=3;powerstorage=3"
slot_flags = SLOT_BELT|SLOT_BACK slot_flags = SLOT_BELT|SLOT_BACK
projectile_type = /obj/item/projectile/beam/heavylaser projectile_type = /obj/item/projectile/beam/heavylaser
charge_cost = 250 charge_cost = 400
max_shots = 5
fire_delay = 20 fire_delay = 20
/obj/item/weapon/gun/energy/lasercannon/mounted /obj/item/weapon/gun/energy/lasercannon/mounted
@@ -72,7 +73,8 @@ obj/item/weapon/gun/energy/retro
fire_sound = 'sound/weapons/laser3.ogg' fire_sound = 'sound/weapons/laser3.ogg'
origin_tech = "combat=5;materials=3;magnets=2;syndicate=2" origin_tech = "combat=5;materials=3;magnets=2;syndicate=2"
projectile_type = /obj/item/projectile/beam/xray projectile_type = /obj/item/projectile/beam/xray
charge_cost = 50 charge_cost = 100
max_shots = 20
fire_delay = 1 fire_delay = 1
/obj/item/weapon/gun/energy/sniperrifle /obj/item/weapon/gun/energy/sniperrifle
@@ -84,7 +86,8 @@ obj/item/weapon/gun/energy/retro
origin_tech = "combat=6;materials=5;powerstorage=4" origin_tech = "combat=6;materials=5;powerstorage=4"
projectile_type = /obj/item/projectile/beam/sniper projectile_type = /obj/item/projectile/beam/sniper
slot_flags = SLOT_BACK slot_flags = SLOT_BACK
charge_cost = 250 charge_cost = 400
max_shots = 4
fire_delay = 35 fire_delay = 35
force = 10 force = 10
w_class = 4 w_class = 4

View File

@@ -4,8 +4,8 @@
icon_state = "energystun100" icon_state = "energystun100"
item_state = null //so the human update icon uses the icon_state instead. item_state = null //so the human update icon uses the icon_state instead.
fire_sound = 'sound/weapons/Taser.ogg' fire_sound = 'sound/weapons/Taser.ogg'
max_shots = 10
charge_cost = 100 //How much energy is needed to fire.
projectile_type = /obj/item/projectile/beam/stun projectile_type = /obj/item/projectile/beam/stun
origin_tech = "combat=3;magnets=2" origin_tech = "combat=3;magnets=2"
modifystate = "energystun" modifystate = "energystun"

View File

@@ -6,14 +6,14 @@
slot_flags = SLOT_BELT|SLOT_BACK slot_flags = SLOT_BELT|SLOT_BACK
force = 10 force = 10
fire_sound='sound/weapons/Laser.ogg' fire_sound='sound/weapons/Laser.ogg'
charge_cost = 50
projectile_type = /obj/item/projectile/beam projectile_type = /obj/item/projectile/beam
sel_mode = 2 sel_mode = 2
max_shots = 10
firemodes = list( firemodes = list(
list(name="stun", projectile_type=/obj/item/projectile/beam/stun, fire_sound='sound/weapons/Taser.ogg'), list(name="stun", projectile_type=/obj/item/projectile/beam/stun, fire_sound='sound/weapons/Taser.ogg'),
list(name="lethal", projectile_type=/obj/item/projectile/beam, fire_sound='sound/weapons/Laser.ogg'), list(name="lethal", projectile_type=/obj/item/projectile/beam, fire_sound='sound/weapons/Laser.ogg'),
list(name="DESTROY", projectile_type=/obj/item/projectile/beam/pulse, fire_sound='sound/weapons/pulse.ogg', fire_delay=25, charge_cost=100), list(name="DESTROY", projectile_type=/obj/item/projectile/beam/pulse, fire_sound='sound/weapons/pulse.ogg', fire_delay=25, charge_cost=400),
) )
/obj/item/weapon/gun/energy/pulse_rifle/mounted /obj/item/weapon/gun/energy/pulse_rifle/mounted
@@ -27,6 +27,7 @@
fire_delay = 25 fire_delay = 25
fire_sound='sound/weapons/pulse.ogg' fire_sound='sound/weapons/pulse.ogg'
projectile_type=/obj/item/projectile/beam/pulse projectile_type=/obj/item/projectile/beam/pulse
charge_cost=400
/obj/item/weapon/gun/energy/pulse_rifle/destroyer/attack_self(mob/living/user as mob) /obj/item/weapon/gun/energy/pulse_rifle/destroyer/attack_self(mob/living/user as mob)
user << "<span class='warning'>[src.name] has three settings, and they are all DESTROY.</span>" user << "<span class='warning'>[src.name] has three settings, and they are all DESTROY.</span>"
@@ -37,4 +38,4 @@
desc = "It's not the size of the gun, it's the size of the hole it puts through people." desc = "It's not the size of the gun, it's the size of the hole it puts through people."
slot_flags = SLOT_BELT|SLOT_HOLSTER slot_flags = SLOT_BELT|SLOT_HOLSTER
icon_state = "m1911-p" icon_state = "m1911-p"
cell_type = /obj/item/weapon/cell/crap max_shots = 5

View File

@@ -9,7 +9,8 @@
force = 10 force = 10
flags = CONDUCT flags = CONDUCT
slot_flags = SLOT_BACK slot_flags = SLOT_BACK
charge_cost = 100 charge_cost = 300
max_shots = 10
projectile_type = /obj/item/projectile/ion projectile_type = /obj/item/projectile/ion
/obj/item/weapon/gun/energy/ionrifle/emp_act(severity) /obj/item/weapon/gun/energy/ionrifle/emp_act(severity)
@@ -29,7 +30,7 @@
item_state = "decloner" item_state = "decloner"
fire_sound = 'sound/weapons/pulse3.ogg' fire_sound = 'sound/weapons/pulse3.ogg'
origin_tech = "combat=5;materials=4;powerstorage=3" origin_tech = "combat=5;materials=4;powerstorage=3"
charge_cost = 100 max_shots = 10
projectile_type = /obj/item/projectile/energy/declone projectile_type = /obj/item/projectile/energy/declone
/obj/item/weapon/gun/energy/floragun /obj/item/weapon/gun/energy/floragun
@@ -39,6 +40,7 @@
item_state = "floramut" item_state = "floramut"
fire_sound = 'sound/effects/stealthoff.ogg' fire_sound = 'sound/effects/stealthoff.ogg'
charge_cost = 100 charge_cost = 100
max_shots = 10
projectile_type = /obj/item/projectile/energy/floramut projectile_type = /obj/item/projectile/energy/floramut
origin_tech = "materials=2;biotech=3;powerstorage=3" origin_tech = "materials=2;biotech=3;powerstorage=3"
modifystate = "floramut" modifystate = "floramut"
@@ -65,7 +67,6 @@
slot_flags = SLOT_BELT|SLOT_BACK slot_flags = SLOT_BELT|SLOT_BACK
w_class = 4 w_class = 4
projectile_type = /obj/item/projectile/meteor projectile_type = /obj/item/projectile/meteor
charge_cost = 100
cell_type = /obj/item/weapon/cell/potato cell_type = /obj/item/weapon/cell/potato
self_recharge = 1 self_recharge = 1
recharge_time = 5 //Time it takes for shots to recharge (in ticks) recharge_time = 5 //Time it takes for shots to recharge (in ticks)
@@ -110,7 +111,7 @@
flags = CONDUCT flags = CONDUCT
slot_flags = SLOT_BACK slot_flags = SLOT_BACK
w_class = 4.0 w_class = 4.0
charge_cost = 200 max_shots = 5
projectile_type = /obj/item/projectile/change projectile_type = /obj/item/projectile/change
origin_tech = null origin_tech = null
self_recharge = 1 self_recharge = 1
@@ -127,7 +128,7 @@
name = "staff of animation" name = "staff of animation"
desc = "An artefact that spits bolts of life-force which causes objects which are hit by it to animate and come to life! This magic doesn't affect machines." desc = "An artefact that spits bolts of life-force which causes objects which are hit by it to animate and come to life! This magic doesn't affect machines."
projectile_type = /obj/item/projectile/animate projectile_type = /obj/item/projectile/animate
charge_cost = 100 max_shots = 10
obj/item/weapon/gun/energy/staff/focus obj/item/weapon/gun/energy/staff/focus
name = "mental focus" name = "mental focus"
@@ -140,11 +141,11 @@ obj/item/weapon/gun/energy/staff/focus
/* /*
attack_self(mob/living/user as mob) attack_self(mob/living/user as mob)
if(projectile_type == "/obj/item/projectile/forcebolt") if(projectile_type == "/obj/item/projectile/forcebolt")
charge_cost = 200 charge_cost = 400
user << "<span class='warning'>The [src.name] will now strike a small area.</span>" user << "<span class='warning'>The [src.name] will now strike a small area.</span>"
projectile_type = "/obj/item/projectile/forcebolt/strong" projectile_type = "/obj/item/projectile/forcebolt/strong"
else else
charge_cost = 100 charge_cost = 200
user << "<span class='warning'>The [src.name] will now strike only a single person.</span>" user << "<span class='warning'>The [src.name] will now strike only a single person.</span>"
projectile_type = "/obj/item/projectile/forcebolt" projectile_type = "/obj/item/projectile/forcebolt"
*/ */

View File

@@ -4,9 +4,8 @@
icon_state = "taser" icon_state = "taser"
item_state = null //so the human update icon uses the icon_state instead. item_state = null //so the human update icon uses the icon_state instead.
fire_sound = 'sound/weapons/Taser.ogg' fire_sound = 'sound/weapons/Taser.ogg'
charge_cost = 100 max_shots = 5
projectile_type = /obj/item/projectile/beam/stun projectile_type = /obj/item/projectile/beam/stun
cell_type = /obj/item/weapon/cell/crap
/obj/item/weapon/gun/energy/taser/mounted /obj/item/weapon/gun/energy/taser/mounted
name = "mounted taser gun" name = "mounted taser gun"
@@ -15,7 +14,7 @@
/obj/item/weapon/gun/energy/taser/mounted/cyborg /obj/item/weapon/gun/energy/taser/mounted/cyborg
name = "taser gun" name = "taser gun"
cell_type = /obj/item/weapon/cell/secborg max_shots = 6
recharge_time = 10 //Time it takes for shots to recharge (in ticks) recharge_time = 10 //Time it takes for shots to recharge (in ticks)
@@ -26,9 +25,8 @@
item_state = "stunrevolver" item_state = "stunrevolver"
fire_sound = 'sound/weapons/Gunshot.ogg' fire_sound = 'sound/weapons/Gunshot.ogg'
origin_tech = "combat=3;materials=3;powerstorage=2" origin_tech = "combat=3;materials=3;powerstorage=2"
charge_cost = 125
projectile_type = /obj/item/projectile/energy/electrode/stunshot projectile_type = /obj/item/projectile/energy/electrode/stunshot
cell_type = /obj/item/weapon/cell max_shots = 8
/obj/item/weapon/gun/energy/crossbow /obj/item/weapon/gun/energy/crossbow
@@ -43,7 +41,7 @@
silenced = 1 silenced = 1
fire_sound = 'sound/weapons/Genhit.ogg' fire_sound = 'sound/weapons/Genhit.ogg'
projectile_type = /obj/item/projectile/energy/bolt projectile_type = /obj/item/projectile/energy/bolt
cell_type = /obj/item/weapon/cell/crap max_shots = 5
self_recharge = 1 self_recharge = 1
charge_meter = 0 charge_meter = 0