Skip to content

Commit 10735c4

Browse files
committed
Adjust randomBackground condition
1 parent 9d6af09 commit 10735c4

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Core/HdPackConditions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,6 @@ struct HdPackRandomBackgroundCondition : public HdPackCondition
399399

400400
bool InternalCheckCondition(HdScreenInfo* screenInfo, int x, int y, HdPpuTileInfo* tile) override
401401
{
402-
return screenInfo->nameTableRandVal[tile->nameTableIdx] >= OperandA;
402+
return screenInfo->nameTableRandVal[tile->nameTableIdx] <= OperandA;
403403
}
404404
};

Docs/content/hdpacks/_index.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,23 @@ The condition is true when the following expression is true:
181181
**Syntax**: `<condition>[name - text], frameRange, [divisorValue - integer], [compareValue - integer]`
182182
**Example**: `<condition>myCondition,frameRange,8,10` (This condition will be true for the last 2 frames out of every 10 frames)
183183

184+
#### spriteFrameRange ####
185+
186+
The spriteFrameRange conditions can be used to conditionally replace sprite tiles based on the number of frames have passed since the sprite is visible on screen.
187+
The condition is true when the following expression is true:
188+
`[number of frames have passed] % [divisorValue] >= [compareValue]`
189+
190+
**Syntax**: `<condition>[name - text], spriteFrameRange, [divisorValue - integer], [compareValue - integer]`
191+
**Example**: `<condition>myCondition,spriteFrameRange,8,10` (This condition will be true for the last 2 frames out of every 10 frames since the sprite is visible)
192+
193+
#### randomBackground ####
194+
195+
The randomBackground conditions can be used to randomly replace background tiles with a given probability.
196+
The condition is true when the following expression is true:
197+
`[random number between 0 and 1 assigned to the tile] <= [compareValue]`
198+
199+
**Syntax**: `<condition>[name - text], randomBackground, [compareValue]`
200+
**Example**: `<condition>myCondition,randomBackground,0.1` (This condition will be true for 10% of the background tiles)
184201

185202
### &lt;tile&gt; tag ###
186203

0 commit comments

Comments
 (0)