’Cause all games were better on the GBC

You are not logged in.

- Index
- → Help/Question
- →
**Two to Five Attacks Effect**

Pages: **1**

**Fotomac****Member**- Registered: 2015-10-25
- Post 315/332

How do you alter the chance of it hitting 2, 3, 4, or 5 times? Because I was thinking of doing so for the latest update to my hack.

Offline

https://github.com/pret/pokered/blob/ma … 8171-L8182

Remove lines 8174-8179 for equal odds.

Offline

**Fotomac****Member**- Registered: 2015-10-25
- Post 316/332

I should like to be more specific. I want it to have a 33.3% chance of hitting 2 times, a 33.3% chance of hitting 3 times, a 16.7% chance of hitting 4 times, and a 16.7% chance of hitting 5 times, as it has been since Gen V.

Offline

Fotomac wrote:

I should like to be more specific. I want it to have a 33.3% chance of hitting 2 times, a 33.3% chance of hitting 3 times, a 16.7% chance of hitting 4 times, and a 16.7% chance of hitting 5 times, as it has been since Gen V.

That's how it works already.

Offline

**Fotomac****Member**- Registered: 2015-10-25
- Post 317/332

Actually, the ratio is kind of different. Before Gen V, each chance was 37.5%, 37.5%, 12.5%, and 12.5%, respectively.

Offline

My bad, replace these lines:

call BattleRandom

and $3

cp $2

jr c, .gotNumHits

; if the number of hits was greater than 2, re-roll again for a lower chance

call BattleRandom

and $3

.gotNumHits

inc a

inc a

with:

call BattleRandom

ld h, 2

cp 33 percent + 1

jr c, .saveNumberOfHits_

inc h

cp 67 percent - 1

jr c, .saveNumberOfHits_

inc h

cp 83 percent + 1

jr c, .saveNumberOfHits_

inc h

.saveNumberOfHits_

ld a, h

*Last edited by Crystal_ (2018-06-03 10:22:52)*

Offline

Pages: **1**

- Index
- → Help/Question
- →
**Two to Five Attacks Effect**