setEffect round up duration, while %d in desc round down

Where bugs go to lie down and rest

Moderator: Moderator

Post Reply
Message
Author
hops
Halfling
Posts: 111
Joined: Tue Sep 21, 2010 9:05 am

setEffect round up duration, while %d in desc round down

#1 Post by hops »

For example, perfect strike at tlvl 1.1, the description says duration=2, while setEffect make it 3.

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: setEffect round up duration, while %d in desc round down

#2 Post by Grey »

Hmm, I believe this is also the case with shield runes, as they always seem to give 1 more turn than advertised.
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

edge2054
Retired Ninja
Posts: 3756
Joined: Fri May 28, 2010 4:38 pm

Re: setEffect round up duration, while %d in desc round down

#3 Post by edge2054 »

I think this actually has to do with the way Zero Usage Speed abilities work. (Both Shield Runes and Perfect Strike are instant use).

The description will say two turns but those two turns don't actually start counting until your next action so generally a timed effect will get set to duration + 1. When you go you see that the duration is what you'd expect but if you're using an instant ability you basically interrupt that first tic.

I encountered something similar with Borrowed Time and it always rounds before it gets passed so I don't think this is a rounding issue. The fix I used for it was to lower the duration by 1 and add a +1 to the duration in the description. I'm sure other instant use chronomancy effects are having a similar issue but Borrowed Time's duration is very short and 1 extra tic was a lot in this instance so I felt it needed to be fixed.

Post Reply