Merge pull request #6027 from Mechoid/Precursotech_Sword

Anomalotech Charge Sword
This commit is contained in:
Neerti
2019-04-14 01:20:30 -04:00
committed by VirgoBot
parent 59b800679a
commit 94e6cc402b
5 changed files with 87 additions and 3 deletions

View File

@@ -134,7 +134,7 @@
/obj/item/weapon/melee/energy/sword/New()
if(random_color)
blade_color = pick("red","blue","green","purple")
blade_color = pick("red","blue","green","purple","white")
lcolor = blade_color
/obj/item/weapon/melee/energy/sword/green/New()
@@ -153,6 +153,10 @@
blade_color = "purple"
lcolor = "#800080"
/obj/item/weapon/melee/energy/sword/white/New()
blade_color = "white"
lcolor = "#FFFFFF"
/obj/item/weapon/melee/energy/sword/activate(mob/living/user)
if(!active)
to_chat(user, "<span class='notice'>\The [src] is now energised.</span>")
@@ -161,7 +165,6 @@
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
icon_state = "[active_state][blade_color]"
/obj/item/weapon/melee/energy/sword/deactivate(mob/living/user)
if(active)
to_chat(user, "<span class='notice'>\The [src] deactivates!</span>")
@@ -237,6 +240,80 @@
target.taunt(user)
target.adjustFireLoss(force * 6) // 30 Burn, for 50 total.
/*
* Charge blade. Uses a cell, and costs energy per strike.
*/
/obj/item/weapon/melee/energy/sword/charge
name = "charge sword"
desc = "A small, handheld device which emits a high-energy 'blade'."
origin_tech = list(TECH_COMBAT = 5, TECH_MAGNET = 3, TECH_ILLEGAL = 4)
active_force = 25
armor_penetration = 25
var/hitcost = 75
var/obj/item/weapon/cell/bcell = null
var/cell_type = /obj/item/weapon/cell/device
/obj/item/weapon/melee/energy/sword/charge/proc/use_charge(var/cost)
if(active)
if(bcell)
if(bcell.checked_use(cost))
return 1
else
return 0
return null
/obj/item/weapon/melee/energy/sword/charge/examine(mob/user)
if(!..(user, 1))
return
if(bcell)
to_chat(user, "<span class='notice'>The blade is [round(bcell.percent())]% charged.</span>")
if(!bcell)
to_chat(user, "<span class='warning'>The blade does not have a power source installed.</span>")
/obj/item/weapon/melee/energy/sword/charge/attack_self(mob/user as mob)
if((!bcell || bcell.charge < hitcost) && !active)
to_chat(user, "<span class='notice'>\The [src] does not seem to have power.</span>")
return
..()
/obj/item/weapon/melee/energy/sword/charge/attack(mob/M, mob/user)
if(active)
if(!use_charge(hitcost))
deactivate(user)
visible_message("<span class='notice'>\The [src]'s blade flickers, before retracting.</span>")
return ..()
/obj/item/weapon/melee/energy/sword/charge/attackby(obj/item/weapon/W, mob/user)
if(istype(W, cell_type))
if(!bcell)
user.drop_item()
W.loc = src
bcell = W
to_chat(user, "<span class='notice'>You install a cell in [src].</span>")
update_icon()
else
to_chat(user, "<span class='notice'>[src] already has a cell.</span>")
else if(W.is_screwdriver() && bcell)
bcell.update_icon()
bcell.forceMove(get_turf(loc))
bcell = null
to_chat(user, "<span class='notice'>You remove the cell from \the [src].</span>")
deactivate()
update_icon()
return
else
..()
/obj/item/weapon/melee/energy/sword/charge/get_cell()
return bcell
/obj/item/weapon/melee/energy/sword/charge/loaded/New()
..()
bcell = new/obj/item/weapon/cell/device/weapon(src)
/*
*Energy Blade
*/

View File

@@ -17,3 +17,10 @@
materials = list(DEFAULT_WALL_MATERIAL = 500)
build_path = /obj/item/weapon/storage/box/syndie_kit/chameleon
sort_string = "VASBA"
/datum/design/item/weapon/esword
id = "chargesword"
req_tech = list(TECH_COMBAT = 6, TECH_MAGNET = 4, TECH_ENGINEERING = 5, TECH_ILLEGAL = 4, TECH_ANOMALY = 1)
materials = list(MAT_PLASTEEL = 3500, "glass" = 1000, MAT_LEAD = 2250, MAT_METALHYDROGEN = 500)
build_path = /obj/item/weapon/melee/energy/sword/charge
sort_string = "VASCA"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 42 KiB