fix fungal disease/essences hurting team mates~

This commit is contained in:
bgkillas 2024-10-20 07:39:18 -04:00
parent ba8801db87
commit 1576c2daa4
6 changed files with 107 additions and 2 deletions

View file

@ -0,0 +1,24 @@
dofile_once("data/scripts/lib/utilities.lua")
dofile_once("mods/quant.ew/files/resource/shoot_projectile_fix.lua")
local entity_id = GetUpdatedEntityID()
local pos_x, pos_y = EntityGetTransform( entity_id )
SetRandomSeed( pos_x, pos_y )
local how_many = 16
local angle_inc = ( 2 * 3.14159 ) / how_many
local theta = math.rad( Random( 1,360 ) )
local length = 300
local parent_id = EntityGetParent( entity_id )
if (parent_id ~= NULL_ENTITY) then
for i=1,how_many do
local vel_x = math.cos( theta ) * length
local vel_y = math.sin( theta ) * length
theta = theta + angle_inc
shoot_projectile( parent_id, "data/entities/misc/essences/air_bullet.xml", pos_x, pos_y, vel_x, vel_y )
end
end

View file

@ -0,0 +1,11 @@
dofile_once("data/scripts/lib/utilities.lua")
dofile_once("mods/quant.ew/files/resource/shoot_projectile_fix.lua")
local entity_id = GetUpdatedEntityID()
local pos_x, pos_y = EntityGetTransform( entity_id )
local parent_id = EntityGetParent( entity_id )
if (parent_id ~= NULL_ENTITY) then
shoot_projectile( parent_id, "data/entities/misc/essences/fire_explosion.xml", pos_x, pos_y, 0, 0 )
end

View file

@ -0,0 +1,24 @@
dofile_once("data/scripts/lib/utilities.lua")
dofile_once("mods/quant.ew/files/resource/shoot_projectile_fix.lua")
local entity_id = GetUpdatedEntityID()
local pos_x, pos_y = EntityGetTransform( entity_id )
SetRandomSeed( pos_x, pos_y )
local how_many = 8
local angle_inc = ( 2 * 3.14159 ) / how_many
local theta = math.rad( Random( 1,360 ) )
local length = 300
local parent_id = EntityGetParent( entity_id )
if (parent_id ~= NULL_ENTITY) then
for i=1,how_many do
local vel_x = math.cos( theta ) * length
local vel_y = math.sin( theta ) * length
theta = theta + angle_inc
shoot_projectile( parent_id, "data/entities/misc/essences/laser_bullet.xml", pos_x, pos_y, vel_x, vel_y )
end
end

View file

@ -0,0 +1,19 @@
dofile_once("data/scripts/lib/utilities.lua")
dofile_once("mods/quant.ew/files/resource/shoot_projectile_fix.lua")
local entity_id = GetUpdatedEntityID()
local pos_x, pos_y = EntityGetTransform( entity_id )
SetRandomSeed( pos_x, pos_y )
local theta = math.rad( Random( 1,360 ) )
local length = 300
local parent_id = EntityGetParent( entity_id )
if (parent_id ~= NULL_ENTITY) then
local vel_x = math.cos( theta ) * length
local vel_y = math.sin( theta ) * length
shoot_projectile( parent_id, "data/entities/misc/essences/water_bullet.xml", pos_x, pos_y, vel_x, vel_y )
end

View file

@ -0,0 +1,28 @@
dofile_once("data/scripts/lib/utilities.lua")
dofile_once("data/scripts/gun/procedural/gun_action_utils.lua")
dofile_once("mods/quant.ew/files/resource/shoot_projectile_fix.lua")
local entity_id = GetUpdatedEntityID()
local root_id = EntityGetRootEntity( entity_id )
local x,y = EntityGetTransform( entity_id )
SetRandomSeed( x * entity_id, y + GameGetFrameNum() )
local rnd = Random( 1, 10 )
local vel_x = Random( -100, 100 )
local vel_y = Random( -100, 100 )
if ( rnd == 10 ) then
shoot_projectile( root_id, "data/entities/misc/perks/spore_pod.xml", x, y, vel_x, vel_y )
elseif ( rnd > 6 ) then
for i=1,5 do
vel_x = Random( -400, 400 )
vel_y = Random( -400, 100 )
shoot_projectile( root_id, "data/entities/misc/perks/spore_pod_spike.xml", x, y, vel_x, vel_y )
end
elseif ( rnd > 3 ) then
for i=1,2 do
vel_x = Random( -400, 400 )
vel_y = Random( -400, 100 )
shoot_projectile( root_id, "data/entities/misc/perks/spore_pod_spike.xml", x, y, vel_x, vel_y )
end
end