// File: /workspace/github_cpp_makefile_star2_O2/Matteo-Grellier[P]RPG/Menu.cpp
// Function: Menu::actions(Character&)
void Menu::actions(Character& character) {


    toScreen(
    " ",
    "c'est au tour de " + character.name + " de jouer",
    " ");

    if (character.getJob() != 7 ){

        int awnser = ask("| 1. attaquer | 2. " + character.getSpecialActionName() + " | 3. boire une potion |", "quel action souhaitez vous effectuer ?");
        int subAwnser;

        string targetList = targetListing();

        if (awnser == 1) {
            subAwnser = ask(
            targetList,
            "quel personnage souhaitez vous attaquer ?");


            character.attack(*Character::charactersList[subAwnser]);

        } else if (awnser == 2) {

            if (character.getJob() != 3) {
                subAwnser = ask(
                targetList,
                "quel personnage voulez vous viser ?");

                character.launchSpecialAction(*Character::charactersList[subAwnser]);
            } else {
                character.launchSpecialAction(character);
            }

        } else if (awnser == 3) {

            subAwnser = ask("| 0. Grande potion | 1. Moyenne potion | 2. Petite potion |", "choisissez une potion");

            character.drink(*Character::potionsList[subAwnser]);

        } else {
            toScreen(
            " ",
            "Action inconnu",
            " ");

            actions(character);

        }


    } else {
        character.launchSpecialAction(character);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rdi, %rbx
leaq 0x223d(%rip), %rsi      # 0x7531
leaq -0x218(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x2c78
leaq 0x8(%rbx), %rdx
leaq 0x21f4(%rip), %rsi      # 0x7503
leaq -0x38(%rbp), %rdi
callq 0x2de5
leaq 0x21f6(%rip), %rdx      # 0x7515
leaq -0x1f8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2dbc
leaq 0x21fb(%rip), %rsi      # 0x7531
leaq -0x1d8(%rbp), %rdi
leaq -0x11(%rbp), %rdx
callq 0x2c78
leaq -0x218(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
leaq -0x1d8(%rbp), %rdx
callq 0x4e84
leaq -0x1d8(%rbp), %rdi
callq 0x22a8
leaq -0x1f8(%rbp), %rdi
callq 0x22a8
leaq -0x38(%rbp), %rdi
callq 0x22a8
leaq -0x218(%rbp), %rdi
callq 0x22a8
movq %rbx, %rdi
callq 0x3900
cmpl $0x7, %eax
jne 0x53ab
movq (%rbx), %rax
movq %rbx, %rdi
movq %rbx, %rsi
callq *0x8(%rax)
jmp 0x565a
movq (%rbx), %rax
leaq -0x58(%rbp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq *(%rax)
leaq 0x215e(%rip), %rsi      # 0x751f
leaq -0x38(%rbp), %rdi
movq %r14, %rdx
callq 0x5b1a
leaq 0x215f(%rip), %rdx      # 0x7533
leaq -0x1b8(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x2dbc
leaq 0x2161(%rip), %rsi      # 0x754c
leaq -0x198(%rbp), %rdi
leaq -0x11(%rbp), %rdx
callq 0x2c78
leaq -0x1b8(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x4f88
movl %eax, %r14d
leaq -0x198(%rbp), %rdi
callq 0x22a8
leaq -0x1b8(%rbp), %rdi
callq 0x22a8
leaq -0x38(%rbp), %rdi
callq 0x22a8
leaq -0x58(%rbp), %rdi
callq 0x22a8
leaq -0x38(%rbp), %rdi
callq 0x5780
cmpl $0x3, %r14d
je 0x5555
cmpl $0x2, %r14d
je 0x54d1
cmpl $0x1, %r14d
jne 0x55cf
leaq -0x178(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq 0x20fe(%rip), %rsi      # 0x7573
leaq -0x158(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x2c78
leaq -0x178(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0x4f88
movl %eax, %r14d
leaq -0x158(%rbp), %rdi
callq 0x22a8
leaq -0x178(%rbp), %rdi
callq 0x22a8
movslq %r14d, %rax
leaq 0x5cd3(%rip), %rcx      # 0xb190
movq (%rcx), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x3428
jmp 0x5651
movq %rbx, %rdi
callq 0x3900
movq %rbx, %rsi
cmpl $0x3, %eax
je 0x5547
leaq -0x138(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x21e0
leaq 0x20a5(%rip), %rsi      # 0x759d
leaq -0x118(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x2c78
leaq -0x138(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x4f88
movl %eax, %r14d
leaq -0x118(%rbp), %rdi
callq 0x22a8
leaq -0x138(%rbp), %rdi
callq 0x22a8
movslq %r14d, %rax
leaq 0x5c50(%rip), %rcx      # 0xb190
movq (%rcx), %rcx
movq (%rcx,%rax,8), %rsi
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x8(%rax)
jmp 0x5651
leaq 0x2065(%rip), %rsi      # 0x75c1
leaq -0xf8(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x2c78
leaq 0x208a(%rip), %rsi      # 0x75fd
leaq -0xd8(%rbp), %rdi
leaq -0x11(%rbp), %rdx
callq 0x2c78
leaq -0xf8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x4f88
movl %eax, %r14d
leaq -0xd8(%rbp), %rdi
callq 0x22a8
leaq -0xf8(%rbp), %rdi
callq 0x22a8
movslq %r14d, %rax
leaq 0x5bed(%rip), %rcx      # 0xb1a8
movq (%rcx), %rcx
movq (%rcx,%rax,8), %rsi
movq %rbx, %rdi
callq 0x31f6
jmp 0x5651
leaq 0x1f5b(%rip), %rsi      # 0x7531
leaq -0xb8(%rbp), %rdi
leaq -0x58(%rbp), %rdx
callq 0x2c78
leaq 0x2026(%rip), %rsi      # 0x7613
leaq -0x98(%rbp), %rdi
leaq -0x11(%rbp), %rdx
callq 0x2c78
leaq 0x1f2d(%rip), %rsi      # 0x7531
leaq -0x78(%rbp), %rdi
leaq -0x12(%rbp), %rdx
callq 0x2c78
leaq -0xb8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x4e84
leaq -0x78(%rbp), %rdi
callq 0x22a8
leaq -0x98(%rbp), %rdi
callq 0x22a8
leaq -0xb8(%rbp), %rdi
callq 0x22a8
movq %rbx, %rdi
callq 0x52dc
leaq -0x38(%rbp), %rdi
callq 0x22a8
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rbx
leaq -0x118(%rbp), %rdi
callq 0x22a8
jmp 0x567a
movq %rax, %rbx
leaq -0x138(%rbp), %rdi
jmp 0x56e6
movq %rax, %rbx
leaq -0x78(%rbp), %rdi
callq 0x22a8
jmp 0x5694
movq %rax, %rbx
leaq -0x98(%rbp), %rdi
callq 0x22a8
jmp 0x56c7
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0x22a8
jmp 0x56d3
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x22a8
jmp 0x56df
movq %rax, %rbx
leaq -0xb8(%rbp), %rdi
jmp 0x56e6
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
jmp 0x56e6
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x22a8
jmp 0x572d
jmp 0x572a
jmp 0x572a
movq %rax, %rbx
leaq -0x198(%rbp), %rdi
callq 0x22a8
jmp 0x5705
movq %rax, %rbx
leaq -0x1b8(%rbp), %rdi
callq 0x22a8
jmp 0x5716
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x22a8
jmp 0x5724
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
jmp 0x576d
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
jmp 0x576d
movq %rax, %rbx
leaq -0x1d8(%rbp), %rdi
callq 0x22a8
jmp 0x5747
movq %rax, %rbx
leaq -0x1f8(%rbp), %rdi
callq 0x22a8
jmp 0x5758
movq %rax, %rbx
leaq -0x38(%rbp), %rdi
callq 0x22a8
jmp 0x5766
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x22a8
movq %rbx, %rdi
callq 0x2260
movq %rax, %rbx
jmp 0x5772
nop