Skip to content

Commit

Permalink
weapon update support
Browse files Browse the repository at this point in the history
  • Loading branch information
sayterdarkwynd committed Oct 16, 2019
1 parent dba0180 commit a68ae85
Show file tree
Hide file tree
Showing 24 changed files with 267 additions and 43 deletions.
7 changes: 7 additions & 0 deletions animations/largehitsparkcrit/largehitsparkcrit.animation
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"frames" : "largehitsparkcrit.png",
"variants" : 1,
"frameNumber" : 5,
"animationCycle" : 0.15,
"offset" : [0, 0]
}
7 changes: 7 additions & 0 deletions animations/largehitsparkcrit/largehitsparkcrit.frames
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"frameGrid" : {
"size" : [43, 43],
"dimensions" : [5, 1]
}
}

Binary file added animations/largehitsparkcrit/largehitsparkcrit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 5 additions & 1 deletion items/active/weapons/ranged/gun.animation.patch
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
"fire3" : [],
"cooldown" : [],
"crit" : [ "/sfx/melee/axe_kill_organic2.ogg" ],
"fuReload" : [ "/sfx/weapons/pistolreloadfast2.ogg" ]
"fuReload" : [ "/sfx/weapons/reloadfast1.ogg" ],
"fuReload2" : [ "/sfx/weapons/reloadfast2.ogg" ],
"fuReload3" : [ "/sfx/weapons/reloadmid1.ogg" ],
"fuReload4" : [ "/sfx/weapons/reloadmid2.ogg" ],
"fuReload5" : [ "/sfx/weapons/reloadslow.ogg" ]
}
}

Expand Down
30 changes: 27 additions & 3 deletions items/active/weapons/ranged/gunfire.lua
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ self.reloadTime = config.getParameter("reloadTime") or 1 -- how long does reloa
else
self.magazineAmount = self.magazineAmount - 1
end
sb.logInfo(self.magazineAmount)
end

local species = world.entitySpecies(activeItem.ownerEntityId())
Expand Down Expand Up @@ -228,7 +227,19 @@ self.reloadTime = config.getParameter("reloadTime") or 1 -- how long does reloa
self.cooldownTimer = self.fireTime + self.reloadTime
status.addEphemeralEffect("reloadReady", 0.25)
self.magazineAmount = self.magazineSize
animator.playSound("fuReload") -- adds new sound to reload

self.reloadTime = config.getParameter("reloadTime",0)
if (self.reloadTime < 0.08) then
animator.playSound("fuReload") -- adds new sound to reload
elseif (self.reloadTime >= 2.5) then
animator.playSound("fuReload5") -- adds new sound to reload
elseif (self.reloadTime >= 2) then
animator.playSound("fuReload4") -- adds new sound to reload
elseif (self.reloadTime >= 1.5) then
animator.playSound("fuReload3") -- adds new sound to reload
elseif (self.reloadTime >= 1) then
animator.playSound("fuReload2") -- adds new sound to reload
end
end

self.weapon:setStance(self.stances.cooldown)
Expand Down Expand Up @@ -297,7 +308,20 @@ self.reloadTime = config.getParameter("reloadTime") or 1 -- how long does reloa
self.cooldownTimer = ((self.fireTime - self.burstTime) * self.burstCount) + self.reloadTime
status.addEphemeralEffect("reloadReady", 0.25)
self.magazineAmount = self.magazineSize
animator.playSound("fuReload") -- adds new sound to reload

self.reloadTime = config.getParameter("reloadTime",0)
if (self.reloadTime < 0.08) then
animator.playSound("fuReload") -- adds new sound to reload
elseif (self.reloadTime >= 2.5) then
animator.playSound("fuReload5") -- adds new sound to reload
elseif (self.reloadTime >= 2) then
animator.playSound("fuReload4") -- adds new sound to reload
elseif (self.reloadTime >= 1.5) then
animator.playSound("fuReload3") -- adds new sound to reload
elseif (self.reloadTime >= 1) then
animator.playSound("fuReload2") -- adds new sound to reload
end

self.weapon:setStance(self.stances.cooldown)
self:setState(self.cooldown)
end
Expand Down
30 changes: 26 additions & 4 deletions items/active/weapons/ranged/gunfirefixed.lua
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,20 @@ function GunFireFixed:auto()
end
if (self.isAmmoBased==1) and (self.magazineAmount <= 0) then
self.cooldownTimer = self.fireTime + self.reloadTime
status.addEphemeralEffect("reloadReady", 0.25)
status.addEphemeralEffect("reloadReady", 0.5)
self.magazineAmount = self.magazineSize
animator.playSound("fuReload") -- adds new sound to reload
self.reloadTime = config.getParameter("reloadTime",0)
if (self.reloadTime < 0.08) then
animator.playSound("fuReload") -- adds new sound to reload
elseif (self.reloadTime >= 2.5) then
animator.playSound("fuReload5") -- adds new sound to reload
elseif (self.reloadTime >= 2) then
animator.playSound("fuReload4") -- adds new sound to reload
elseif (self.reloadTime >= 1.5) then
animator.playSound("fuReload3") -- adds new sound to reload
elseif (self.reloadTime >= 1) then
animator.playSound("fuReload2") -- adds new sound to reload
end
self.weapon:setStance(self.stances.cooldown)
self:setState(self.cooldown)
end
Expand Down Expand Up @@ -347,9 +358,20 @@ function GunFireFixed:burst() -- burst auto should be a thing here
end
if (self.isAmmoBased==1) and (self.magazineAmount <= 0) then
self.cooldownTimer = self.burstCooldown + self.reloadTime
status.addEphemeralEffect("reloadReady", 0.25)
status.addEphemeralEffect("reloadReady", 0.5)
self.magazineAmount = self.magazineSize
animator.playSound("fuReload") -- adds new sound to reload
self.reloadTime = config.getParameter("reloadTime",0)
if (self.reloadTime < 0.08) then
animator.playSound("fuReload") -- adds new sound to reload
elseif (self.reloadTime >= 2.5) then
animator.playSound("fuReload5") -- adds new sound to reload
elseif (self.reloadTime >= 2) then
animator.playSound("fuReload4") -- adds new sound to reload
elseif (self.reloadTime >= 1.5) then
animator.playSound("fuReload3") -- adds new sound to reload
elseif (self.reloadTime >= 1) then
animator.playSound("fuReload2") -- adds new sound to reload
end
self.weapon:setStance(self.stances.cooldown)
self:setState(self.cooldown)
end
Expand Down
Binary file removed sfx/weapons/pistolreload.ogg
Binary file not shown.
Binary file removed sfx/weapons/pistolreloadfast2.ogg
Binary file not shown.
Binary file removed sfx/weapons/pistolreloadmedium.ogg
Binary file not shown.
Binary file removed sfx/weapons/pistolreloadslow.ogg
Binary file not shown.
File renamed without changes.
Binary file added sfx/weapons/reloadfast2.ogg
Binary file not shown.
Binary file added sfx/weapons/reloadmid1.ogg
Binary file not shown.
Binary file added sfx/weapons/reloadmid2.ogg
Binary file not shown.
Binary file added sfx/weapons/reloadslow.ogg
Binary file not shown.
47 changes: 47 additions & 0 deletions stats/effects/fu_weaponeffects/crithit/critReady.animation
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"particleEmitters" : {
"smoke" : {
"emissionRate" : 15,
"offsetRegion" : [ 3.0, 1.0, 3.0, 1.0 ],
"particles" : [
{ "particle" : "smoke" },
{ "particle" : "smoke" },
{ "particle" : "smoke" },
{ "particle" : "smoke" }
]
},
"critText" : {
"enabled" : true,
"emissionRate" : 1.0,
"particles" : [
{
"particle" : {
"type" : "text",
"text" : "Max Crit",
"size" : 0.3,
"color" : [255, 255, 255, 255],
"fade" : 0.4,
"destructionAction" : "shrink",
"destructionTime" : 0.5,
"position" : [0.0, 1.0],
"offsetRegion" : [0, 0, 0, 0],
"initialVelocity" : [0, 6],
"finalVelocity" : [0, 3],
"approach" : [0, 10],
"timeToLive" : 0.5,
"variance" : {}
}
}
]
}
},

"transformationGroups" : {
"smoke" : { "interpolated" : true }
},


"sounds" : {
"burn" : [ "/sfx/statuseffects/powerup.ogg" ]
}
}
31 changes: 31 additions & 0 deletions stats/effects/fu_weaponeffects/crithit/critReady.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
function init()
if status.stat("isCharged") == 1 then
activateVisualEffects()
end
self.timer = 10
script.setUpdateDelta(10)
end


function activateVisualEffects()
if status.stat("isCharged") == 1 then
local statusTextRegion = { 0, 1, 0, 1 }
animator.setParticleEmitterOffsetRegion("critText", statusTextRegion)
animator.burstParticleEmitter("critText")
animator.playSound("burn")
-- animator.burstParticleEmitter("smoke")
effect.setParentDirectives("fade=008800=0.2")
end

end



function update(dt)

end


function uninit()

end
13 changes: 13 additions & 0 deletions stats/effects/fu_weaponeffects/crithit/critReady.statuseffect
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name" : "critReady",
"blockingStat" : "critImmunity",

"effectConfig" : {},
"defaultDuration" : 0.25,

"scripts" : [
"critReady.lua"
],

"animationConfig" : "critReady.animation"
}
38 changes: 11 additions & 27 deletions stats/effects/fu_weaponeffects/crithit/crithit.animation
Original file line number Diff line number Diff line change
@@ -1,39 +1,23 @@
{
"particleEmitters" : {
"smoke" : {
"emissionRate" : 15,
"offsetRegion" : [ 3.0, 1.0, 3.0, 1.0 ],
"particles" : [
{ "particle" : "blood" },
{ "particle" : "blood" },
{ "particle" : "blood" },
{ "particle" : "blood" },
{ "particle" : "blood" },
{ "particle" : "blood" },
{ "particle" : "blood" },
{ "particle" : "blood" }
]
},
"statustext" : {
"enabled" : true,
"emissionRate" : 1.0,
"emissionRate" : 0.5,
"particles" : [
{
"particle" : {
"type" : "text",
"text" : "Crit",
"size" : 0.4,
"color" : [255, 125, 66, 255],
"type" : "animated",
"mode" : "LoopForever",
"animation" : "/animations/largehitsparkcrit/largehitsparkcrit.animation",
"size" : 0.5,
"color" : [255, 255, 255, 255],
"fade" : 0.4,
"destructionAction" : "shrink",
"destructionTime" : 0.5,
"position" : [0.0, 1.0],
"position" : [0.0, 2.0],
"offsetRegion" : [0, 0, 0, 0],
"initialVelocity" : [0, 6],
"finalVelocity" : [0, 3],
"approach" : [0, 10],
"timeToLive" : 0.5,
"variance" : {}
"initialVelocity" : [0, 0.0],
"finalVelocity" : [0, 0.0],
"approach" : [0, 5],
"timeToLive" : 0.4
}
}
]
Expand Down
14 changes: 7 additions & 7 deletions stats/effects/fu_weaponeffects/crithit/crithit.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
function init()
animator.playSound("burn")
activateVisualEffects()
effect.setParentDirectives("fade=770000=0.25")
script.setUpdateDelta(10)
--effect.setParentDirectives("fade=770000=0.25")
script.setUpdateDelta(2)

end


function activateVisualEffects()
--local statusTextRegion = { 0, 1, 0, 1 }
--animator.setParticleEmitterOffsetRegion("statustext", statusTextRegion)
--animator.burstParticleEmitter("statustext")
--animator.playSound("burn")
--animator.burstParticleEmitter("smoke")
local statusTextRegion = { 0, 0, 0, 0 }
animator.setParticleEmitterOffsetRegion("smoke", statusTextRegion)
animator.burstParticleEmitter("smoke")
end


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"blockingStat" : "critImmunity",

"effectConfig" : {},
"defaultDuration" : 1,
"defaultDuration" : 0.2,

"scripts" : [
"crithit.lua"
Expand Down
47 changes: 47 additions & 0 deletions stats/effects/fu_weaponeffects/crithit/reloadReady.animation
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"particleEmitters" : {
"smoke" : {
"emissionRate" : 15,
"offsetRegion" : [ 0, 2.0, 0, 2.0 ],
"particles" : [
{ "particle" : "bouncyspark" },
{ "particle" : "bouncyspark" },
{ "particle" : "bouncyspark" },
{ "particle" : "bouncyspark" }
]
},
"reloadText" : {
"enabled" : true,
"emissionRate" : 1.0,
"particles" : [
{
"particle" : {
"type" : "text",
"text" : "Reload",
"size" : 0.3,
"color" : [255, 255, 255, 255],
"fade" : 0.4,
"destructionAction" : "shrink",
"destructionTime" : 0.5,
"position" : [0.0, 2.0],
"offsetRegion" : [0, 0, 0, 0],
"initialVelocity" : [0, 0],
"finalVelocity" : [0, 0],
"approach" : [0, 10],
"timeToLive" : 0.5,
"variance" : {}
}
}
]
}
},

"transformationGroups" : {
"smoke" : { "interpolated" : true }
},


"sounds" : {
"burn" : [ "/sfx/statuseffects/powerup.ogg" ]
}
}
25 changes: 25 additions & 0 deletions stats/effects/fu_weaponeffects/crithit/reloadReady.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
function init()
activateVisualEffects()
self.timer = 0.5
script.setUpdateDelta(5)
end


function activateVisualEffects()
local statusTextRegion = { 0, 1, 0, 1 }
animator.setParticleEmitterOffsetRegion("reloadText", statusTextRegion)
animator.burstParticleEmitter("reloadText")
effect.setParentDirectives("fade=0055aa=0.2")
--animator.burstParticleEmitter("smoke")
end



function update(dt)

end


function uninit()

end
13 changes: 13 additions & 0 deletions stats/effects/fu_weaponeffects/crithit/reloadReady.statuseffect
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name" : "reloadReady",
"blockingStat" : "reloadImmunity",

"effectConfig" : {},
"defaultDuration" : 0.5,

"scripts" : [
"reloadReady.lua"
],

"animationConfig" : "reloadReady.animation"
}

0 comments on commit a68ae85

Please sign in to comment.