Jump to content

Perk = Clock


Recommended Posts

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

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

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 by zUsername
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...