PikalaxALT icon

DeadinskyKicksAPuppy.asm

PikalaxALT | PRO | 11/24/15 08:11:38 PM UTC | 0 ⭐ | 4678 👁️ | Never ⏰ | []
Z80 Assembler |

0 B

|

None

|

0 👍

/

0 👎

CompareTwoDiceRolls:
    push de
    call .RollDice
    pop de
    push bc
    call .RollDice
    ld a, c
    pop bc
    cp c
    ret
 
.RollDice
.loop
    call Random
    cp e
    jr nc, .loop
    cp 3
    jr c, .skip
    inc c
.skip
    dec d
    jr nz, .loop
    ret
 
DeadinskyVsPuppyRolloff:
    lb de, 5, 6
    call CompareTwoDiceRolls
    jr c, .DeadinskyWins
    jr nz, .PuppiesWin
; Tie
    ld a, 4
    jr .proceed
.DeadinskyWins
    xor a
    jr .proceed
.PuppiesWin
    ld a, 2
.proceed
    ld c, a
    ld b, 0
    ld a, [wPuppyKickingText]
    sla a
    ld e, a
    ld d, 0
    ld hl, PuppyResultTexts
    add hl, de
    add hl, de
    add hl, de
    add hl, bc
    ld a, [hli]
    ld h, [hl]
    ld l, a
    jp PrintText
 
PuppyResultTexts:
INCLUDE "data/result_text.asm"

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎

    
        
  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎