mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-13 11:43:31 +00:00
Somatoray Modularity
This commit is contained in:
@@ -225,18 +225,26 @@
|
|||||||
if(seed && seed.get_trait(TRAIT_IMMUTABLE) > 0)
|
if(seed && seed.get_trait(TRAIT_IMMUTABLE) > 0)
|
||||||
return
|
return
|
||||||
|
|
||||||
//Override for somatoray projectiles.
|
// Override for somatoray projectiles.
|
||||||
if(istype(Proj ,/obj/item/projectile/energy/floramut)&& prob(20))
|
// Change the mutchance var to buff or nerf somatorays, it will be multiplied by the tier of the laser.
|
||||||
if(istype(Proj, /obj/item/projectile/energy/floramut/gene))
|
var/mutchance = 15
|
||||||
var/obj/item/projectile/energy/floramut/gene/G = Proj
|
if(istype(Proj ,/obj/item/projectile/energy/floramut))
|
||||||
if(seed)
|
var/obj/item/projectile/energy/floramut/GM = Proj
|
||||||
seed = seed.diverge_mutate_gene(G.gene, get_turf(loc)) //get_turf just in case it's not in a turf.
|
mutchance *= GM.lasermod
|
||||||
else
|
if(prob(mutchance))
|
||||||
mutate(1)
|
if(istype(Proj, /obj/item/projectile/energy/floramut/gene))
|
||||||
|
var/obj/item/projectile/energy/floramut/gene/G = Proj
|
||||||
|
if(seed)
|
||||||
|
seed = seed.diverge_mutate_gene(G.gene, get_turf(loc)) //get_turf just in case it's not in a turf.
|
||||||
|
else
|
||||||
|
mutate(1)
|
||||||
|
return
|
||||||
|
else if(istype(Proj ,/obj/item/projectile/energy/florayield))
|
||||||
|
var/obj/item/projectile/energy/floramut/GY = Proj
|
||||||
|
mutchance *= GY.lasermod
|
||||||
|
if(prob(mutchance))
|
||||||
|
yield_mod = min(10,yield_mod+rand(1,2))
|
||||||
return
|
return
|
||||||
else if(istype(Proj ,/obj/item/projectile/energy/florayield) && prob(20))
|
|
||||||
yield_mod = min(10,yield_mod+rand(1,2))
|
|
||||||
return
|
|
||||||
|
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
|||||||
@@ -48,8 +48,13 @@
|
|||||||
modifystate = "floramut"
|
modifystate = "floramut"
|
||||||
cell_type = /obj/item/weapon/cell/device/weapon/recharge
|
cell_type = /obj/item/weapon/cell/device/weapon/recharge
|
||||||
battery_lock = 1
|
battery_lock = 1
|
||||||
|
|
||||||
var/decl/plantgene/gene = null
|
var/decl/plantgene/gene = null
|
||||||
|
<<<<<<< HEAD
|
||||||
recoil_mode = 0 //CHOMP Addition
|
recoil_mode = 0 //CHOMP Addition
|
||||||
|
=======
|
||||||
|
var/obj/item/weapon/stock_parts/micro_laser/emitter
|
||||||
|
>>>>>>> dead3acae1... Merge pull request #11841 from FartMaster69420/somatoray
|
||||||
|
|
||||||
firemodes = list(
|
firemodes = list(
|
||||||
list(mode_name="induce mutations", projectile_type=/obj/item/projectile/energy/floramut, modifystate="floramut"),
|
list(mode_name="induce mutations", projectile_type=/obj/item/projectile/energy/floramut, modifystate="floramut"),
|
||||||
@@ -57,8 +62,42 @@
|
|||||||
list(mode_name="induce specific mutations", projectile_type=/obj/item/projectile/energy/floramut/gene, modifystate="floramut"),
|
list(mode_name="induce specific mutations", projectile_type=/obj/item/projectile/energy/floramut/gene, modifystate="floramut"),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/floragun/Initialize()
|
||||||
|
. = ..()
|
||||||
|
emitter = new(src)
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/floragun/examine(var/mob/user)
|
||||||
|
. = ..()
|
||||||
|
if(Adjacent(user))
|
||||||
|
. += "It has [emitter ? emitter : "no micro laser"] installed."
|
||||||
|
|
||||||
|
/obj/item/weapon/gun/energy/floragun/attackby(obj/item/W, mob/user)
|
||||||
|
if(istype(W, /obj/item/weapon/stock_parts/micro_laser))
|
||||||
|
if(!emitter)
|
||||||
|
user.drop_item()
|
||||||
|
W.loc = src
|
||||||
|
emitter = W
|
||||||
|
to_chat(user, "<span class='notice'>You install a [emitter.name] in [src].</span>")
|
||||||
|
else
|
||||||
|
to_chat(user, "<span class='notice'>[src] already has a laser.</span>")
|
||||||
|
|
||||||
|
else if(W.is_screwdriver())
|
||||||
|
if(emitter)
|
||||||
|
to_chat(user, "<span class='notice'>You remove the [emitter.name] from the [src].</span>")
|
||||||
|
emitter.loc = get_turf(src.loc)
|
||||||
|
playsound(src, W.usesound, 50, 1)
|
||||||
|
emitter = null
|
||||||
|
return
|
||||||
|
else
|
||||||
|
to_chat(user, "<span class='notice'>There is no micro laser in this [src].</span>")
|
||||||
|
return
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/floragun/afterattack(obj/target, mob/user, adjacent_flag)
|
/obj/item/weapon/gun/energy/floragun/afterattack(obj/target, mob/user, adjacent_flag)
|
||||||
//allow shooting into adjacent hydrotrays regardless of intent
|
//allow shooting into adjacent hydrotrays regardless of intent
|
||||||
|
if(!emitter)
|
||||||
|
to_chat(user, "<span class='notice'>The [src] has no laser! </span>")
|
||||||
|
playsound(src, 'sound/weapons/empty.ogg', 50, 1)
|
||||||
|
return
|
||||||
if(adjacent_flag && istype(target,/obj/machinery/portable_atmospherics/hydroponics))
|
if(adjacent_flag && istype(target,/obj/machinery/portable_atmospherics/hydroponics))
|
||||||
user.visible_message("<span class='danger'>\The [user] fires \the [src] into \the [target]!</span>")
|
user.visible_message("<span class='danger'>\The [user] fires \the [src] into \the [target]!</span>")
|
||||||
Fire(target,user)
|
Fire(target,user)
|
||||||
@@ -84,8 +123,16 @@
|
|||||||
/obj/item/weapon/gun/energy/floragun/consume_next_projectile()
|
/obj/item/weapon/gun/energy/floragun/consume_next_projectile()
|
||||||
. = ..()
|
. = ..()
|
||||||
var/obj/item/projectile/energy/floramut/gene/G = .
|
var/obj/item/projectile/energy/floramut/gene/G = .
|
||||||
|
var/obj/item/projectile/energy/florayield/GY = .
|
||||||
|
var/obj/item/projectile/energy/floramut/GM = .
|
||||||
|
// Inserting the upgrade level of the gun to the projectile as there isn't a better way to do this.
|
||||||
if(istype(G))
|
if(istype(G))
|
||||||
G.gene = gene
|
G.gene = gene
|
||||||
|
G.lasermod = emitter.rating
|
||||||
|
else if(istype(GY))
|
||||||
|
GY.lasermod = emitter.rating
|
||||||
|
else if(istype(GM))
|
||||||
|
GM.lasermod = emitter.rating
|
||||||
|
|
||||||
/obj/item/weapon/gun/energy/meteorgun
|
/obj/item/weapon/gun/energy/meteorgun
|
||||||
name = "meteor gun"
|
name = "meteor gun"
|
||||||
|
|||||||
@@ -138,7 +138,7 @@
|
|||||||
light_power = 0.5
|
light_power = 0.5
|
||||||
light_color = "#33CC00"
|
light_color = "#33CC00"
|
||||||
impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser
|
impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser
|
||||||
|
var/lasermod = 0
|
||||||
combustion = FALSE
|
combustion = FALSE
|
||||||
|
|
||||||
/obj/item/projectile/energy/floramut/on_hit(var/atom/target, var/blocked = 0)
|
/obj/item/projectile/energy/floramut/on_hit(var/atom/target, var/blocked = 0)
|
||||||
@@ -195,6 +195,7 @@
|
|||||||
light_power = 0.5
|
light_power = 0.5
|
||||||
light_color = "#FFFFFF"
|
light_color = "#FFFFFF"
|
||||||
impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser
|
impact_effect_type = /obj/effect/temp_visual/impact_effect/monochrome_laser
|
||||||
|
var/lasermod = 0
|
||||||
|
|
||||||
/obj/item/projectile/energy/florayield/on_hit(var/atom/target, var/blocked = 0)
|
/obj/item/projectile/energy/florayield/on_hit(var/atom/target, var/blocked = 0)
|
||||||
var/mob/living/M = target
|
var/mob/living/M = target
|
||||||
|
|||||||
Reference in New Issue
Block a user