Skip to content

Commit

Permalink
Merge pull request #227 from Kherae/master
Browse files Browse the repository at this point in the history
claws
  • Loading branch information
sayterdarkwynd authored May 9, 2020
2 parents 31114f2 + 18ce6ad commit 5b7ff61
Show file tree
Hide file tree
Showing 15 changed files with 237 additions and 265 deletions.
9 changes: 7 additions & 2 deletions stats/effects/fu_genericStatApplier.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ local oldInitStatApplier=init
local oldUninitStatApplier=uninit

function init()
handler=effect.addStatModifierGroup(config.getParameter("stats",{}))
if not genericStatHandler then
genericStatHandler=effect.addStatModifierGroup(config.getParameter("stats",{}))
else
effect.setStatModifierGroup(genericStatHandler,config.getParameter("stats",{}))
end
if oldInitStatApplier then oldInitStatApplier() end
end

function uninit()
effect.removeStatModifierGroup(handler)
effect.removeStatModifierGroup(genericStatHandler)
genericStatHandler=nil
if oldUninitStatApplier then oldUninitStatApplier() end
end
12 changes: 6 additions & 6 deletions tech/other/avaliglide.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ function uninit()
end

function checkFood()
local foodValue=15
if status.isResource("food") then
self.foodValue = status.resource("food")
else
self.foodValue = 15
end
foodValue = status.resource("food")
end
return foodValue
end

function checkStance()
Expand Down Expand Up @@ -61,7 +61,7 @@ end


function update(args)
checkFood()
--checkFood()

if not self.specialLast and args.moves["special1"] then
attemptActivation()
Expand Down Expand Up @@ -115,7 +115,7 @@ function update(args)
mcontroller.controlParameters(config.getParameter("fallingParameters2"))
mcontroller.setYVelocity(math.max(mcontroller.yVelocity(), config.getParameter("maxFallSpeed2")))
end
if self.foodValue > 15 then
if checkFood() > 15 then
status.addEphemeralEffects{{effect = "foodcost", duration = 0.1}}
else
status.overConsumeResource("energy", config.getParameter("energyCostPerSecond"),1)
Expand Down
34 changes: 16 additions & 18 deletions tech/other/dragonfireburst.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,31 @@ function init()
checkFood()
end

function uninit()
--[[function uninit()
end
end]]

function checkFood()
local foodValue=15
if status.isResource("food") then
self.foodValue = status.resource("food")
else
self.foodValue = 15
end
foodValue = status.resource("food")
end
return foodValue
end

function damageConfig()
foodVal = self.foodValue /60
energyVal = status.resource("energy")/150
defenseVal = status.stat("protection") /250
totalVal = foodVal + energyVal + defenseVal
end
--[[function damageConfig()
totalVal =
end]]

function activeFlight()
damageConfig()
local damageConfig = { power = totalVal, damageSourceKind = "fire" }
--damageConfig()
--local damageConfig =
--sb.logInfo("power value from food, energy and protection = "..damageConfig.power)
animator.playSound("activate",3)
animator.playSound("recharge")
animator.setSoundVolume("activate", 0.5,0)
animator.setSoundVolume("recharge", 0.375,0)
world.spawnProjectile("flamethrower", self.mouthPosition, entity.id(), aimVector(), false, damageConfig)
world.spawnProjectile("flamethrower", self.mouthPosition, entity.id(), aimVector(), false, { power = ((self.foodValue /60) + (status.resource("energy")/150) + (status.stat("protection") /250)), damageSourceKind = "fire" })
end

function aimVector()
Expand All @@ -49,7 +46,7 @@ end


function update(args)
checkFood()
--checkFood()

if mcontroller.facingDirection() == 1 then -- what direction are we facing?
if args.moves["down"] then -- are we crouching?
Expand All @@ -68,7 +65,7 @@ function update(args)

self.firetimer = math.max(0, self.firetimer - args.dt)
if args.moves["special1"] and status.overConsumeResource("energy", 0.001) then
if self.foodValue > 15 then
if checkFood() > 15 then
status.addEphemeralEffects{{effect = "foodcostfire", duration = 0.02}}
else
status.overConsumeResource("energy", 0.6)
Expand All @@ -84,6 +81,7 @@ function update(args)
end
end

--[[
function idle()
end
end]]
40 changes: 20 additions & 20 deletions tech/other/elduukharburst.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,38 @@ function init()
self.firetimer = 0
self.facingDirection = 1

checkFood()
--checkFood()
end

function uninit()
--[[function uninit()
end
end]]

function checkFood()
local foodValue=15
if status.isResource("food") then
self.foodValue = status.resource("food")
else
self.foodValue = 15
end
foodValue = status.resource("food")
end
return foodValue
end

function damageConfig()
foodVal = self.foodValue /60
energyVal = status.resource("energy")/150
defenseVal = status.stat("protection") /250
totalVal = foodVal + energyVal + defenseVal
end
--[[function damageConfig()
foodVal =
energyVal =
defenseVal =
totalVal =
end]]

function activeFlight()
damageConfig()
local damageConfig = { power = totalVal, damageSourceKind = "fire", speed = 12 }
--damageConfig()
--local damageConfig =
--sb.logInfo("power value from food, energy and protection = "..damageConfig.power)
animator.playSound("activate",3)
animator.playSound("recharge")
animator.setSoundVolume("activate", 0.5,0)
animator.setSoundVolume("recharge", 0.375,0)

world.spawnProjectile("elduukharflamethrower",self.mouthPosition, entity.id(), aimVector(), false, damageConfig)
world.spawnProjectile("elduukharflamethrower",self.mouthPosition, entity.id(), aimVector(), false, { power = ((checkFood() /60) + (status.resource("energy")/150) + (status.stat("protection") /250)), damageSourceKind = "fire", speed = 12 })
end

function aimVector()
Expand All @@ -52,7 +52,7 @@ end


function update(args)
checkFood()
--checkFood()

if mcontroller.facingDirection() == 1 then -- what direction are we facing?
if args.moves["down"] then -- are we crouching?
Expand All @@ -72,7 +72,7 @@ function update(args)
self.firetimer = math.max(0, self.firetimer - args.dt)
if args.moves["special1"] and status.overConsumeResource("energy", 0.001) then
self.facingDirection = world.distance(aimVector(), mcontroller.position())[1] > 0 and 1 or -1 --what direction are we facing
if self.foodValue > 15 then
if checkFood() > 15 then
status.addEphemeralEffects{{effect = "foodcostfire", duration = 0.02}}
else
status.overConsumeResource("energy", 0.6)
Expand All @@ -87,7 +87,7 @@ function update(args)
animator.stopAllSounds("activate")
end
end

--[[
function idle()
end
end]]
12 changes: 6 additions & 6 deletions tech/other/flighttest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ function uninit()
end

function checkFood()
local foodValue=15
if status.isResource("food") then
self.foodValue = status.resource("food")
else
self.foodValue = 15
end
foodValue = status.resource("food")
end
return foodValue
end

function activeFlight()
Expand All @@ -44,7 +44,7 @@ function animateFlight()
end

function update(args)
checkFood()
--checkFood()
if args.moves["special1"] and not mcontroller.onGround() and not mcontroller.zeroG() and status.overConsumeResource("energy", 0.001) then
if self.timer then
self.timer = math.max(0, self.timer - args.dt)
Expand All @@ -54,7 +54,7 @@ function update(args)
end
end
--if not (self.species == "avian") then
if self.foodValue > 15 then
if checkFood() > 15 then
status.addEphemeralEffects{{effect = "foodcost", duration = 0.1}}
else
status.overConsumeResource("energy", config.getParameter("energyCostPerSecond"),1)
Expand Down
14 changes: 7 additions & 7 deletions tech/other/flighttestsaturn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ function uninit()
end

function checkFood()
if status.isResource("food") then
self.foodValue = status.resource("food")
else
self.foodValue = 15
end
local foodValue=15
if status.isResource("food") then
foodValue = status.resource("food")
end
return foodValue
end

function boost(direction)
Expand All @@ -49,7 +49,7 @@ function update(args)
end

if self.active and status.overConsumeResource("energy", 0.0001) and not mcontroller.zeroG() and not mcontroller.liquidMovement() then -- do we have energy and the ability is active?
checkFood()
--checkFood()
status.addEphemeralEffects{{effect = "saturnflight", duration = 2}}

self.upVal = args.moves["up"] --set core movement variables
Expand Down Expand Up @@ -77,7 +77,7 @@ function update(args)
mcontroller.controlApproachVelocity(self.boostVelocity, 30)
-- end boost

if self.foodValue > 15 then
if checkFood() > 15 then
if self.runVal and not self.downVal and not self.leftVal and not self.rightVal and not self.upVal then
status.setPersistentEffects("glide", {
{stat = "gliding", amount = 1},
Expand Down
Loading

0 comments on commit 5b7ff61

Please sign in to comment.