Exemplo n.º 1
0
 private void overRideHero(karakter hero)
 {
     manager.player.myCharacter.Add(hero);
     manager.player.myCharacter[manager.player.myCharacter.Count - 1].min_damage = min_damage;
     manager.player.myCharacter[manager.player.myCharacter.Count - 1].max_damage = max_damage;
     manager.player.myCharacter[manager.player.myCharacter.Count - 1].maxHp      = maxHp;
     manager.player.myCharacter[manager.player.myCharacter.Count - 1].hp         = hp;
     manager.player.myCharacter[manager.player.myCharacter.Count - 1].speed      = speed;
     manager.player.myCharacter[manager.player.myCharacter.Count - 1].level      = level;
     manager.player.myCharacter[manager.player.myCharacter.Count - 1].hero_stress.stress_level = status;
     manager.player.myCharacter[manager.player.myCharacter.Count - 1].hero_stress.stress_point = stress_point;
     manager.player.myCharacter[manager.player.myCharacter.Count - 1].hero_equip = arrEquip;
 }
Exemplo n.º 2
0
        public void getEffect(Inventory inv, karakter karakterPilih)
        {
            if (inv is LargeFood)
            {
                item              = itemUse.bisa;
                karakterPilih.hp += 40;
            }
            else if (inv is SmallFood)
            {
                item              = itemUse.bisa;
                karakterPilih.hp += 20;
            }
            else if (inv is Torch)
            {
                item = itemUse.bisa;
                karakterPilih.hero_stress.stress_point -= 5;
            }
            else if (inv is Bandage)
            {
                item              = itemUse.bisa;
                karakterPilih.hp += 10;
            }
            else if (inv is Gold)
            {
            }
            else if (inv is Jewel)
            {
            }
            else if (inv is Key)
            {
            }
            else if (inv is Shovel)
            {
            }
            else if (inv is TheCure)
            {
                item = itemUse.bisa;
                karakterPilih.hero_buff = efek.none;
                karakterPilih.hp       += 5;
            }
            else if (inv is PotentSalve)
            {
                karakterPilih.hero_buff = efek.heal;
            }

            if (karakterPilih.hero_stress.stress_point <= 0)
            {
                if (karakterPilih.hero_stress.stress_level == stress_stage.depresi)
                {
                    karakterPilih.hero_stress.stress_point = 100 + karakterPilih.hero_stress.stress_point;
                    karakterPilih.hero_stress.stress_level = stress_stage.normal;
                }
                else
                {
                    karakterPilih.hero_stress.stress_point = 0;
                }
            }
            if (karakterPilih.hp >= karakterPilih.maxHp)
            {
                karakterPilih.hp = karakterPilih.maxHp;
            }
        }
Exemplo n.º 3
0
        public override void update()
        {
            if (!gerak)
            {
                gerak_icon += 2;
            }

            else
            {
                gerak_icon -= 2;
            }
            if (gerak_icon > 20 && !gerak)
            {
                gerak = true;
            }
            if (gerak_icon < 0 && gerak)
            {
                gerak = false;
            }

            if (zoom <= 80 && (serang == true || serang_musuh == true))
            {
                zoom     += 30;
                zoom_bkg += 70;
            }

            if (serang)
            {
                timer_attack++;
                player[pilihHero].x += 1;
            }

            if (serang_musuh)
            {
                timer_attack++;
                musuh[pilihMusuh].x -= 1;
            }
            if (timer_attack == 30 && serang == true)
            {
                timer_attack                    = 0;
                zoom                            = 0;
                zoom_bkg                        = 0;
                player[pilihHero].x             = 350 - 100 * pilihHero;
                player[pilihHero].hero_move     = "idle";
                player[pilihHero].hero_move_now = 1;
                serang                          = false;
                if (musuh[targetMusuh].hp <= 0)
                {
                    try
                    {
                        for (int i = 0; i < turnAttack.Count; i++)
                        {
                            if (turnAttack[i].jenis == 0)
                            {
                                if (turnAttack[i].ke == musuh.Count)
                                {
                                    turnAttack.RemoveAt(i);
                                    i--;
                                }
                                else if (turnAttack[i].ke > targetMusuh)
                                {
                                    turnAttack[i].ke--;
                                    musuh[turnAttack[i].ke].x -= 100;
                                }
                            }
                        }
                    }
                    catch (Exception)
                    {
                    }
                    MessageBox.Show("mati");
                    musuh.RemoveAt(targetMusuh);
                }
                winCondition();
                gantiTurn();
            }

            if (timer_attack == 30 && serang_musuh == true)
            {
                timer_attack        = 0;
                zoom                = 0;
                zoom_bkg            = 0;
                musuh[pilihMusuh].x = 700 + pilihMusuh * 100;
                musuh[pilihMusuh].musuh_move_now = 1;
                musuh[pilihMusuh].musuh_move     = "idle";
                serang_musuh         = false;
                player[targetHero].x = 350 - 100 * targetHero;

                if (player[targetHero].hp <= 0)
                {
                    for (int i = 0; i < turnAttack.Count; i++)
                    {
                        if (turnAttack[i].jenis == 1)
                        {
                            if (turnAttack[i].ke == player.Count)
                            {
                                turnAttack.RemoveAt(i);
                                i--;
                            }
                            else if (turnAttack[i].ke > targetHero)
                            {
                                player[turnAttack[i].ke].x += 100;
                                turnAttack[i].ke--;
                            }
                        }
                    }
                    player.RemoveAt(targetHero);
                    if (player.Count == 0)
                    {
                        MessageBox.Show("Mati Semua");
                        for (int i = 0; i < gsm.player.currentCharacters.Count; i++)
                        {
                            if (gsm.player.currentCharacters[i].hp <= 0)
                            {
                                gsm.player.currentCharacters.RemoveAt(i);
                                i--;
                            }
                        }
                        gsm.stage = Stage.mainMenu;
                        gsm.loadState(gsm.stage);
                    }
                }

                gantiTurn();
            }

            if (delay_aktif)
            {
                timer_attack++;
                if (timer_attack == 30)
                {
                    targetHero = r.Next(player.Count);
                    int pilih_attack_musuh = r.Next(1, 4);
                    try
                    {
                        pilihMusuh = turnAttack[turn_ke].ke;
                        musuh[pilihMusuh].skill[pilih_attack_musuh].getDamageSkill(targetHero, player);
                        musuh[pilihMusuh].x              = 650;
                        player[targetHero].x             = 450;
                        musuh[pilihMusuh].musuh_move_now = 1;
                        musuh[pilihMusuh].musuh_move     = "skill" + pilih_attack_musuh;
                    }
                    catch (Exception)
                    {
                        pilihMusuh = turnAttack[turn_ke].ke;
                        pilihMusuh = 0;
                        musuh[pilihMusuh].skill[pilih_attack_musuh].getDamageSkill(targetHero, player);
                        musuh[pilihMusuh].x              = 650;
                        player[targetHero].x             = 450;
                        musuh[pilihMusuh].musuh_move_now = 1;
                        musuh[pilihMusuh].musuh_move     = "skill" + pilih_attack_musuh;
                    }
                    delay_aktif  = false;
                    timer_attack = 0;
                    serang_musuh = true;
                    //sfx.Stop();
                    //string RunningPath = AppDomain.CurrentDomain.BaseDirectory;
                    //string FileName = string.Format("{0}Resources\\yeti_attack_sfx_1.wav", Path.GetFullPath(Path.Combine(RunningPath, @"..\..\")));
                    //sfx.Open(new System.Uri(FileName));
                    //sfx.Play();
                }
            }

            if (timer_geser)
            {
                if (0 == gerak_geser_max)
                {
                    timer_geser  = false;
                    ganti_posisi = false;


                    karakter swap_char = player[pilihHero];
                    player[pilihHero]  = player[targetHero];
                    player[targetHero] = swap_char;



                    int tmp_ind = turnAttack[turn_ke].ke;//0
                    for (int i = 0; i < turnAttack.Count; i++)
                    {
                        if (turnAttack[i].jenis == 1 && turnAttack[i].ke == targetHero)
                        {
                            turnAttack[turn_ke].ke = turnAttack[i].ke;
                            turnAttack[i].ke       = tmp_ind;
                        }
                    }

                    tmp_ind    = pilihHero;
                    pilihHero  = targetHero;
                    targetHero = tmp_ind;
                    gantiTurn();
                }
                else
                {
                    if (pilihHero >= targetHero)
                    {
                        player[pilihHero].x  += gerak_geser;
                        player[targetHero].x -= gerak_geser;
                    }
                    else
                    {
                        player[pilihHero].x  -= gerak_geser;
                        player[targetHero].x += gerak_geser;
                    }
                    gerak_geser_max -= gerak_geser;
                }
            }
        }
Exemplo n.º 4
0
 public rosterList(int x, int y, karakter karakter)
 {
     this.x        = x;
     this.y        = y;
     this.karakter = karakter;
 }
Exemplo n.º 5
0
 public void setKaracter(karakter karakter)
 {
     this.name = karakter;
 }