Exemplo n.º 1
0
        public Starship sendStarship(Starship starship, string systemName)
        {
            if (_systems.Exists(x => x.Name == systemName))
            {
                SSystem sys = _systems.Find(x => x.Name == systemName);
                if (starship.ShipPower <= 20)
                {
                    increaseAgeAndKill(starship.crew, 12, sys.BaseDistance);
                }
                else if (starship.ShipPower > 20 && starship.ShipPower <= 30)
                {
                    increaseAgeAndKill(starship.crew, 6, sys.BaseDistance);
                }
                else if (starship.ShipPower > 30)
                {
                    increaseAgeAndKill(starship.crew, 4, sys.BaseDistance);
                }

                if (starship.ShipPower >= sys.MinShipPower)
                {
                    starship.Gold = sys.Gold;
                    _systems.Remove(sys);
                }
            }
            else
            {
                starship.crew.Clear();
            }
            return(starship);
        }
Exemplo n.º 2
0
    private static void dmSaveSetSysDataForBackup()
    {
        AppMain.GSS_MAIN_SYS_INFO mainSysInfo = AppMain.GsGetMainSysInfo();
        SSystem instance = SSystem.CreateInstance();

        instance.SetKilled(mainSysInfo.ene_kill_count);
        instance.SetPlayerStock(mainSysInfo.rest_player_num);
    }
Exemplo n.º 3
0
    // Token: 0x06000984 RID: 2436 RVA: 0x00055AA4 File Offset: 0x00053CA4
    private static void dmSaveSetSysDataForBackup()
    {
        AppMain.GSS_MAIN_SYS_INFO gss_MAIN_SYS_INFO = AppMain.GsGetMainSysInfo();
        SSystem ssystem = SSystem.CreateInstance();

        ssystem.SetKilled(gss_MAIN_SYS_INFO.ene_kill_count);
        ssystem.SetPlayerStock(gss_MAIN_SYS_INFO.rest_player_num);
    }
Exemplo n.º 4
0
 private void createSystems()
 {
     _systems = new List <SSystem>();
     for (int i = 0; i < 4; i++)
     {
         Random  rnd = new Random(DateTime.Now.Millisecond);
         SSystem sys = new SSystem("System" + i, rnd.Next(10, 40),
                                   rnd.Next(20, 120), rnd.Next(3000, 7000));
         _systems.Add(sys);
     }
 }
    // Token: 0x060009DA RID: 2522 RVA: 0x000579E8 File Offset: 0x00055BE8
    private static bool dmCmnBackupMathCompare()
    {
        AppMain.GSS_MAIN_SYS_INFO gss_MAIN_SYS_INFO = AppMain.GsGetMainSysInfo();
        if (gss_MAIN_SYS_INFO.is_save_run == 0U)
        {
            return(true);
        }
        SSystem  ssystem  = SSystem.CreateInstance();
        SStage   sstage   = SStage.CreateInstance();
        SSpecial sspecial = SSpecial.CreateInstance();
        SOption  soption  = SOption.CreateInstance();
        SSystem  system   = gss_MAIN_SYS_INFO.cmp_backup.GetSystem();
        SStage   sstage2  = gss_MAIN_SYS_INFO.cmp_backup.GetStage();
        SSpecial special  = gss_MAIN_SYS_INFO.cmp_backup.GetSpecial();
        SOption  option   = gss_MAIN_SYS_INFO.cmp_backup.GetOption();

        if (ssystem.GetPlayerStock() != system.GetPlayerStock())
        {
            return(false);
        }
        if (ssystem.GetKilled() != system.GetKilled())
        {
            return(false);
        }
        if (ssystem.GetClearCount() != system.GetClearCount())
        {
            return(false);
        }
        for (int i = 0; i < 7; i++)
        {
            SSystem.EAnnounce index = (SSystem.EAnnounce)i;
            if (ssystem.IsAnnounce(index) != system.IsAnnounce(index))
            {
                return(false);
            }
        }
        return(AppMain.memcmp(sstage2.getData(), sstage.getData()) == 0 && AppMain.memcmp(special.getData(), sspecial.getData()) == 0 && AppMain.memcmp(option.getData(), soption.getData()) == 0);
    }
Exemplo n.º 6
0
    // Token: 0x06000D77 RID: 3447 RVA: 0x00075CDC File Offset: 0x00073EDC
    public static bool GmStartMsgIsExe()
    {
        bool flag = false;

        AppMain.GSS_MAIN_SYS_INFO gss_MAIN_SYS_INFO = AppMain.GsGetMainSysInfo();
        if ((AppMain.g_gs_main_sys_info.game_flag & 4U) == 0U)
        {
            SSystem ssystem  = SSystem.CreateInstance();
            ushort  stage_id = gss_MAIN_SYS_INFO.stage_id;
            if (stage_id != 5)
            {
                if (stage_id != 9)
                {
                    switch (stage_id)
                    {
                    case 21:
                        if (!AppMain.GsMainSysIsStageClear(21))
                        {
                            flag = true;
                        }
                        break;

                    case 22:
                    case 23:
                    case 24:
                    case 25:
                    case 26:
                    case 27:
                        break;

                    default:
                        goto IL_11D;
                    }
                    if (!flag)
                    {
                        if ((512U & gss_MAIN_SYS_INFO.game_flag) != 0U)
                        {
                            if (!ssystem.IsAnnounce(SSystem.EAnnounce.SpecialStageFlick))
                            {
                                flag = true;
                            }
                        }
                        else if (!ssystem.IsAnnounce(SSystem.EAnnounce.SpecialStageTilt))
                        {
                            flag = true;
                        }
                    }
                    if (flag)
                    {
                        if ((512U & gss_MAIN_SYS_INFO.game_flag) != 0U)
                        {
                            ssystem.SetAnnounce(SSystem.EAnnounce.SpecialStageFlick, true);
                        }
                        else
                        {
                            ssystem.SetAnnounce(SSystem.EAnnounce.SpecialStageTilt, true);
                        }
                    }
                }
                else
                {
                    if (!AppMain.GsMainSysIsStageClear(9))
                    {
                        flag = true;
                    }
                    else if ((512U & gss_MAIN_SYS_INFO.game_flag) != 0U)
                    {
                        if (!ssystem.IsAnnounce(SSystem.EAnnounce.TruckFlick))
                        {
                            flag = true;
                        }
                    }
                    else if (!ssystem.IsAnnounce(SSystem.EAnnounce.TruckTilt))
                    {
                        flag = true;
                    }
                    if (flag)
                    {
                        if ((512U & gss_MAIN_SYS_INFO.game_flag) != 0U)
                        {
                            ssystem.SetAnnounce(SSystem.EAnnounce.TruckFlick, true);
                        }
                        else
                        {
                            ssystem.SetAnnounce(SSystem.EAnnounce.TruckTilt, true);
                        }
                    }
                }
            }
            else
            {
                flag = !AppMain.GsMainSysIsStageClear(5);
            }
        }
IL_11D:
        if (flag)
        {
            AppMain.GmMainClearSuspendedPause();
        }
        return(flag);
    }
Exemplo n.º 7
0
        static void Main(string[] args)
        {
            Service1Client cosmos = new Service1Client();

            ServiceReference2.Service1Client firstOrder = new ServiceReference2.Service1Client();
            cosmos.InitializeGame();
            while (true)
            {
                showMenu();
                string choice = Console.ReadLine();
                if (choice == "a")
                {
                    if (_imperiumMoneyAskCount > 0)
                    {
                        int goldFromEmpire = firstOrder.GetMoneyFromImperium();
                        _gold += goldFromEmpire;
                        _imperiumMoneyAskCount--;
                        Console.WriteLine("Dostales {0} hajsu", goldFromEmpire);
                    }
                    else
                    {
                        Console.WriteLine("Nie masz prosb");
                    }
                }
                else if (choice == "b")
                {
                    Console.WriteLine("Aktualne zloto:{0}. Wpisz za ile zlota chcesz kupic statek", _gold);
                    int money = 0;
                    if (Int32.TryParse(Console.ReadLine(), out money))
                    {
                        if (money <= _gold)
                        {
                            starships.Add(cosmos.GetStarship(money));
                            _gold -= money;
                        }
                        else
                        {
                            Console.WriteLine("Nie masz tyle hajsu");
                        }
                    }
                    else
                    {
                        Console.WriteLine("Zla kwota");
                    }
                }
                else if (choice == "c")
                {
                    SSystem toSend = cosmos.GetSystem();
                    if (toSend == null)
                    {
                        _anySystem = false;
                        Console.WriteLine("Brak systemow");
                    }
                    else
                    {
                        Console.WriteLine("System {0}. Odleglosc: {1}", toSend.Name, toSend.BaseDistance);
                        Console.WriteLine("Statkow gotowych do podrozy: {0}", starships.Count);
                        if (starships.Count == 0)
                        {
                            Console.WriteLine("Brak statkow");
                        }
                        else
                        {
                            Console.WriteLine("Wybierz statek wpisujac jego numer albo wyjdz uzywajac e");
                            for (int i = 1; i <= starships.Count; i++)
                            {
                                Starship ship = starships[i - 1];
                                Console.Write("{0} {1}", i, ship.ShipPower);
                                foreach (Person p in ship.crew)
                                {
                                    Console.Write(" {0} {1} {2} ", p.Name, p.Nick, p.Age);
                                }
                                Console.WriteLine();
                            }
                            string option = Console.ReadLine();
                            if (option == "e")
                            {
                                continue;
                            }
                            else
                            {
                                int shipNumber = 0;
                                if (Int32.TryParse(option, out shipNumber))
                                {
                                    if (shipNumber <= starships.Count && shipNumber != 0)
                                    {
                                        Starship starship = starships[shipNumber - 1];
                                        starships.RemoveAt(shipNumber - 1);
                                        Starship starshipAfterSend = cosmos.sendStarship(starship, toSend.Name);
                                        if (starshipAfterSend.Gold > 0)
                                        {
                                            _gold += starshipAfterSend.Gold;
                                            starshipAfterSend.Gold = 0;
                                        }
                                        if (starshipAfterSend.crew.Length > 0)
                                        {
                                            starships.Add(starshipAfterSend);
                                        }
                                        foreach (Person p in starshipAfterSend.crew)
                                        {
                                            Console.WriteLine(p.Age);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                else if (choice == "d")
                {
                    Console.WriteLine(!_anySystem?"Wygrana":"Przegrana");
                    break;
                }
            }
            Console.ReadLine();
        }
Exemplo n.º 8
0
    public static bool GmStartMsgIsExe()
    {
        bool flag = false;

        AppMain.GSS_MAIN_SYS_INFO mainSysInfo = AppMain.GsGetMainSysInfo();
        if (((int)AppMain.g_gs_main_sys_info.game_flag & 4) == 0)
        {
            SSystem instance = SSystem.CreateInstance();
            switch (mainSysInfo.stage_id)
            {
            case 5:
                flag = !AppMain.GsMainSysIsStageClear(5);
                break;

            case 9:
                if (!AppMain.GsMainSysIsStageClear(9))
                {
                    flag = true;
                }
                else if ((512 & (int)mainSysInfo.game_flag) != 0)
                {
                    if (!instance.IsAnnounce(SSystem.EAnnounce.TruckFlick))
                    {
                        flag = true;
                    }
                }
                else if (!instance.IsAnnounce(SSystem.EAnnounce.TruckTilt))
                {
                    flag = true;
                }
                if (flag)
                {
                    if ((512 & (int)mainSysInfo.game_flag) != 0)
                    {
                        instance.SetAnnounce(SSystem.EAnnounce.TruckFlick, true);
                        break;
                    }
                    instance.SetAnnounce(SSystem.EAnnounce.TruckTilt, true);
                    break;
                }
                break;

            case 21:
                if (!AppMain.GsMainSysIsStageClear(21))
                {
                    flag = true;
                    goto case 22;
                }
                else
                {
                    goto case 22;
                }

            case 22:
            case 23:
            case 24:
            case 25:
            case 26:
            case 27:
                if (!flag)
                {
                    if ((512 & (int)mainSysInfo.game_flag) != 0)
                    {
                        if (!instance.IsAnnounce(SSystem.EAnnounce.SpecialStageFlick))
                        {
                            flag = true;
                        }
                    }
                    else if (!instance.IsAnnounce(SSystem.EAnnounce.SpecialStageTilt))
                    {
                        flag = true;
                    }
                }
                if (flag)
                {
                    if ((512 & (int)mainSysInfo.game_flag) != 0)
                    {
                        instance.SetAnnounce(SSystem.EAnnounce.SpecialStageFlick, true);
                        break;
                    }
                    instance.SetAnnounce(SSystem.EAnnounce.SpecialStageTilt, true);
                    break;
                }
                break;
            }
        }
        if (flag)
        {
            AppMain.GmMainClearSuspendedPause();
        }
        return(flag);
    }