// Use this for initialization
 void Start()
 {
     attackDic = gameObject.AddComponent <AllAttacks>();
     enemy     = SetEnemyType(gameObject.name);
     Attacks   = new AttackOptions[] {
         AttackOptions.Attack,
         AttackOptions.Defend
     };
 }
Beispiel #2
0
        public void UpdateGui()
        {
            for (int i = 0; i < 100; i++)
            {
                AllPlacements[i] = 0;
            }
            for (int ship = 0; ship < 5; ship++)
            {
                if (!ShowShipPlacement[ship])
                {
                    continue;
                }
                for (var x = 0; x < 10; x++)
                {
                    for (var y = 0; y < 10; y++)
                    {
                        AllPlacements[x * 10 + y] += ShipPlacements[ship, x, y];
                    }
                }
            }

            var expectedAttacksPerCell    = AllAttacks.Sum(x => x) / 100f;
            var expectedPlacementsPerCell = AllPlacements.Sum(x => x) / 100f;

            for (int i = 0; i < 100; i++)
            {
                AttackHeat[i]    = AllAttacks[i] / expectedAttacksPerCell;
                PlacementHeat[i] = AllPlacements[i] / expectedPlacementsPerCell;
            }

            TotalLosses = 0;
            TotalHits   = 0;
            TotalMisses = 0;
            TotalShots  = 0;
            LossAttacks = 0;
            WinAttacks  = 0;

            _score = 0;
            foreach (var captainStatistics in CaptainStatistics.Values)
            {
                TotalLosses += captainStatistics.Losses;
                _score      += captainStatistics.Wins;
                TotalHits   += captainStatistics.Hits;
                TotalMisses += captainStatistics.Misses;
                LossAttacks += captainStatistics.LossAttacks;
                TotalShots  += (captainStatistics.Misses + captainStatistics.Hits);
                WinAttacks  += captainStatistics.WinAttacks;
            }

            AttacksPerWin  = (float)WinAttacks / _score;
            AttacksPerLoss = (float)LossAttacks / TotalLosses;
            Accuracy       = (float)TotalHits / (TotalHits + TotalMisses);

            RaisePropertyChanges();
        }
 // Use this for initialization
 void Start()
 {
     attackDic = gameObject.AddComponent <AllAttacks>();
     Attacks   = new AttackOptions[] {
         AttackOptions.Attack,
         AttackOptions.Defend,
         AttackOptions.Willpower,
     };
     Willpowers = new AttackOptions[]
     {
         AttackOptions.Distract
     };
 }
Beispiel #4
0
    /*  public  libreriaDeScrips()
     *    {
     *    inventario = GameObject.Find("objetos/objetos").GetComponent<Inventario>();
     *    Itens = GameObject.Find("objetos/objetos").GetComponent<Items>();
     *    SeleccionDeCriaturas = GameObject.Find("Crewild/Crewild").GetComponent<CrewildChoiseSelect>();
     *    Batalla = GameObject.Find("baltle interfaceC/baltle interface").GetComponent<animationScritpBatle>();
     *    Ataques = GameObject.Find("Game Manager").GetComponent<AllAttacks>();
     *    Crewilldslist = GameObject.Find("Game Manager").GetComponent<AllCrewild>();
     *    todasLasPosturas = GameObject.Find("Game Manager").GetComponent<AllPostura>();
     *    ControlManag = GameObject.Find("Game Manager").GetComponent<ControlManager>();
     *    PanelJugador = GameObject.Find("Jugador/Jugador").GetComponent<PanelJugador>();
     *    informacionCrewild = GameObject.Find("informacion/estadisticas").GetComponent<informacionCrewild>();
     *    saveData = GameObject.Find("guardado/panel").GetComponent<SaveDatos>();
     *    menuInterface = GameObject.Find("Game Manager").GetComponent<menus_interface>();
     *    PlayerMov = GameObject.Find("personaje").GetComponent<movimiento>();
     *    TiendaMenus = FindObjectOfType<TiendaScript>();
     *    audioMenus = GameObject.Find("Game Manager").GetComponent<AudiosMenus>();
     *    JugadorInfo = FindObjectOfType<PanelJugador>();
     *    Equipo = FindObjectOfType<equipo>();
     *    PcScritp = FindObjectOfType<Pc>();
     * } */

    public void Awake()
    {
        inventario           = GameObject.Find("objetos/objetos").GetComponent <Inventario>();
        Itens                = GameObject.Find("objetos/objetos").GetComponent <Items>();
        SeleccionDeCriaturas = GameObject.Find("Crewild/Crewild").GetComponent <CrewildChoiseSelect>();
        Batalla              = GameObject.Find("baltle interfaceC/baltle interface").GetComponent <animationScritpBatle>();
        Ataques              = GameObject.Find("Game Manager").GetComponent <AllAttacks>();
        Crewilldslist        = GameObject.Find("Game Manager").GetComponent <AllCrewild>();
        todasLasPosturas     = GameObject.Find("Game Manager").GetComponent <AllPostura>();
        ControlManag         = GameObject.Find("Game Manager").GetComponent <ControlManager>();
        PanelJugador         = GameObject.Find("Jugador/Jugador").GetComponent <PanelJugador>();
        informacionCrewild   = GameObject.Find("informacion/estadisticas").GetComponent <informacionCrewild>();
        saveData             = GameObject.Find("guardado/panel").GetComponent <SaveDatos>();
        menuInterface        = GameObject.Find("Game Manager").GetComponent <menus_interface>();
        PlayerMov            = GameObject.Find("personaje").GetComponent <movimiento>();
        TiendaMenus          = FindObjectOfType <TiendaScript>();
        audioMenus           = GameObject.FindObjectOfType <AudiosMenus>();
        JugadorInfo          = FindObjectOfType <PanelJugador>();
        Equipo               = FindObjectOfType <equipo>();
        PcScritp             = FindObjectOfType <Pc>();
    }
Beispiel #5
0
 private void Awake()
 {
     Instance = this;
 }