BlueSideWind Posted February 9, 2016 Share Posted February 9, 2016 so the type ability I want to get here is one base on the time of clock. Like every time the clock ticks it would decrease lets say damage by 0.1 point all the way to mid day. But from mid day to night you grow stronger and stronger until the day ends and it repeats. Link to comment Share on other sites More sharing options...
zUsername Posted February 9, 2016 Share Posted February 9, 2016 Are you sure you want to decrease damage every time clock ticks? Because in DST clock tick running in milisecond. So in 1 second you will lose 1 point. Link to comment Share on other sites More sharing options...
BlueSideWind Posted February 9, 2016 Author Share Posted February 9, 2016 1 hour ago, zUsername said: Are you sure you want to decrease damage every time clock ticks? Because in DST clock tick running in milisecond. So in 1 second you will lose 1 point. I was just using it as an example. Its basicly over time you grow strong and over time you grow weak Link to comment Share on other sites More sharing options...
Muche Posted February 9, 2016 Share Posted February 9, 2016 clocksegschanged or clocktick events of TheWorld seem like a good place to start. Link to comment Share on other sites More sharing options...
zUsername Posted February 9, 2016 Share Posted February 9, 2016 (edited) You can use an idea provide by Muche or you can take a look with this code. Every second if day time it's will decrease your damage by 0.1 and in dusk and night time it's will increase your damage by 0.1. inst:DoPeriodicTask( 1 , function() if TheWorld.state.isday then inst.components.combat.damagebonus = (inst.components.combat.damagebonus or 0) - 0.1 else inst.components.combat.damagebonus = (inst.components.combat.damagebonus or 0) + 0.1 end end) Edited February 10, 2016 by zUsername Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now