Ejemplo n.º 1
0
        public void Add(Titan titan)
        {
            // get the next Id
            titan.Id = _repo.Last().Id + 1;

            _repo.Add(titan);
        }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        //references scripts
        ScriptT  = GameObject.Find("Titan").GetComponent <Titan> ();
        ScriptG  = GameObject.Find("Ksvk").GetComponent <Gun>();
        healthUI = GameObject.Find("Thealth").GetComponent <Text> ();

        // set's the main camera
        cameraMain = Camera.main;

        //makes the cursor invisible
        Cursor.visible = false;

        //locks the mouse (doesn't click something off screen)
        Cursor.lockState = CursorLockMode.Locked;

        //sets text
        healthUI.text = "Health: 10";
        current       = SceneManager.GetActiveScene();
        //makes titan instant
        if (current.name == "Training")
        {
            ScriptT.titanfall = 0;
        }
    }
Ejemplo n.º 3
0
        static void Orbwalker_OnPostAttack(AttackableUnit target, EventArgs args)
        {
            if (Orbwalker.ActiveModesFlags != Orbwalker.ActiveModes.None && target != null && target.IsValidTarget())
            {
                if (!Q.IsReady() && !W.IsReady() && CanCastHydra())
                {
                    Hydra.Cast();
                }
                if (!Q.IsReady() && !W.IsReady() && CanCastTitan())
                {
                    Titan.Cast();
                }
                lastAA = Core.GameTickCount;
                if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo) || Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear))
                {
                    if ((Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.Combo)))
                    {
                        if (QNum == 2 && W.IsReady())
                        {
                            var target2 = (ComboTarget != null && ComboTarget.IsValidTarget(WRange)) ? ComboTarget :
                                          TargetSelector.GetTarget(WRange, DamageType.Physical, null, true);
                            if (target2 != null && target2.IsValidTarget() && !CanCastHydra())
                            {
                                Player.CastSpell(SpellSlot.W);
                                return;
                            }
                            if (CanCastHydra())
                            {
                                Hydra.Cast();
                            }
                        }
                    }
                    if (Orbwalker.ActiveModesFlags.HasFlag(Orbwalker.ActiveModes.JungleClear))
                    {
                        if (QNum == 2 && W.IsReady())
                        {
                            var target2 = (JCTarget != null && JCTarget.IsValidTarget(WRange)) ? JCTarget : EntityManager.MinionsAndMonsters.GetJungleMonsters(null, WRange, true).FirstOrDefault();
                            if (target2 != null && target2.IsValidTarget() && !CanCastHydra())
                            {
                                Player.CastSpell(SpellSlot.W);
                                return;
                            }
                            if (CanCastHydra())
                            {
                                Hydra.Cast();
                            }
                        }
                    }


                    if (target.IsValidTarget(Q.Range) && target.IsValid && !target.IsDead && !target.IsZombie)
                    {
                        if (QNum != 2 || !W.IsReady())
                        {
                            Player.CastSpell(SpellSlot.Q, target.Position);
                        }
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public void Update(Titan titan)
        {
            // Delete
            Delete(titan);

            // Then Add
            Add(titan);
        }
Ejemplo n.º 5
0
 public TitanAI(Titan titan, Battle controlBattle, List <ResourcePoint> occupiedResources, IEnumerable <string> queueOfCommands)
 {
     Titan            = titan;
     battle           = controlBattle;
     CollectResources = new CollectResourcesState(this, battle.Planet, occupiedResources);
     DoNothing        = new DoNothingState(this);
     KillAllEnemy     = new KillAllEnemiesState(this, battle.Planet);
     commandsQueue    = new Queue <string>(queueOfCommands);
     SetState(new WaitingState(this, CollectResources, 5));
 }
Ejemplo n.º 6
0
 public void OnRemoveTitan(Titan titan)
 {
     foreach (var titanView in titanList)
     {
         if (titanView != null && titanView.Titan == titan)
         {
             playerFactionController.OnRemoveTitan(titanView);
         }
     }
     // TODO remove corps
 }
Ejemplo n.º 7
0
 public void Init(Titan controlTitan)
 {
     gameObject.SetActive(true);
     Titan = controlTitan;
     Titan.SetView(this);
     name = Titan.Name;
     transform.position = Titan.Position;
     transform.rotation = Titan.UpRotation;
     UpdateResourceCollectionEffect();
     OnUpdateLives();
 }
Ejemplo n.º 8
0
        private void Start()
        {
            if (!testingEnabled)
            {
                return;
            }

            var spriteStore = FindObjectOfType <SpriteStore>();

            spriteStore.Setup();

            var itemStore = FindObjectOfType <ItemStore>();

            itemStore.Setup();

            var travelManager = FindObjectOfType <TravelManager>();

            travelManager.NewParty();

            travelManager.CurrentBiome = testingBiome;

            var numBandits = Random.Range(MinBandits, MaxBandits + 1);

            var bandits = new List <Entity>();

            for (var i = 0; i < 1; i++)
            {
                Entity bandit = new Spider();

                bandits.Add(bandit);

                bandit = new Titan();

                bandits.Add(bandit);

                bandit = new Treant();

                bandits.Add(bandit);

                bandit = new Vampire();

                bandits.Add(bandit);

                bandit = new Zombie();

                bandits.Add(bandit);
            }

            var combatManager = FindObjectOfType <CombatManager>();

            combatManager.Enemies = bandits;

            combatManager.LoadCombatScene();
        }
Ejemplo n.º 9
0
        private void MoveTo(Titan enemy)
        {
            if (enemy == null)
            {
                return;
            }
            var delta        = (titan.Position - enemy.Position).normalized * pursuitDistance;
            var needPosition = (enemy.Position + delta).normalized * planet.Radius;

            titan.ClearTasks();
            titan.AddMoveTask(needPosition);
        }
Ejemplo n.º 10
0
 public override void Update(float deltaTime)
 {
     if (!titanAI.Titan.IsAlive)
     {
         titanAI.SetState(titanAI.DoNothing);
         return;
     }
     if (enemy == null || !enemy.IsAlive)
     {
         enemy = FindNearestEnemy();
     }
     MoveTo(enemy);
 }
 public StickerRegister_Titan()
 {
     InitializeComponent();
     Titan.GetAll().GetMales().ForEach(x => fatherName_x_id.Add(x.Name, x.ID));
     Titan.GetAll().GetFemales().ForEach(x => motherName_x_id.Add(x.Name, x.ID));
     StickerNewStricker.StickerImage.Source = Sprite.Get("unknown").Source;
     //StickerNewStricker.StickerFrame.Source = Sprite.Get(Rarity.Unknown).Source;
     ComboBoxRarity.ItemsSource   = rarityOptions.Keys;
     ComboBoxGender.ItemsSource   = genderOptions.Keys;
     ComboBoxFather.ItemsSource   = fatherName_x_id.Keys;
     ComboBoxMother.ItemsSource   = motherName_x_id.Keys;
     ComboBoxRarity.SelectedIndex = ComboBoxFather.SelectedIndex = ComboBoxGender.SelectedIndex = ComboBoxMother.SelectedIndex = 0;
 }
Ejemplo n.º 12
0
    public static TitanView CreateTitan(Titan titan, Transform parent)
    {
        var titanPrefabName = "Prefabs/Titans/cylinder";//"Prefabs/Titans/titan";

        if (titan.Faction.ID == 1)
        {
            titanPrefabName = "Prefabs/Titans/titan_enemy";
        }
        var titanView = GameObject.Instantiate(Resources.Load <TitanView>(titanPrefabName), parent);

        titanView.Init(titan);
        return(titanView);
    }
Ejemplo n.º 13
0
        public IHttpActionResult Post([FromBody] Titan value)
        {
            try
            {
                TitanService service = new TitanService();
                service.Add(value);

                return(Ok(value));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }
Ejemplo n.º 14
0
    // Use this for initialization
    void Start()
    {
        //sets references
        ScriptT  = GameObject.Find("Titan").GetComponent <Titan>();
        ScriptP  = GameObject.Find("Player").GetComponent <Player>();
        Interact = GameObject.Find("Interact").GetComponent <Text>();
        clip     = GameObject.Find("Clip").GetComponent <Text> ();

        //sets parts of UI to false
        ReloadM.gameObject.SetActive(false);
        ReloadA.gameObject.SetActive(false);
        BPM.gameObject.SetActive(false);
        Interact.gameObject.SetActive(false);
        clip.text = "Clip: 5";
    }
Ejemplo n.º 15
0
 public void Show(List <Titan.Task> tasks, Titan controlTitan)
 {
     titan   = controlTitan;
     markers = SplitTaskMarkers(tasks);
     CreateNeedElementsCount(markers.Count);
     for (int i = 0; i < cancelButtons.Count; i++)
     {
         var needShow = i < markers.Count;
         if (needShow)
         {
             cancelButtons[i].Show(markers[i].Position, i, CancelAction);
         }
         else
         {
             cancelButtons[i].Hide();
         }
     }
 }
Ejemplo n.º 16
0
    // Use this for initialization
    void Start()
    {
        anim    = GetComponent <Animator> ();
        titan   = GameObject.Find("Titan");
        scriptT = GameObject.Find("Titan").GetComponent <Titan> ();

        //if player is active
        if (scriptT.Activate == false)
        {
            pactive = true;
            player  = GameObject.Find("Player");
            scriptG = GameObject.Find("Ksvk").GetComponent <Gun> ();
        }
        //if player isn't active
        else if (scriptT.Activate == true)
        {
            pactive = false;
        }
    }
Ejemplo n.º 17
0
 // Use this for initialization
 void Start()
 {
     logic      = GameObject.Find("Logic").GetComponent <Logic> ();
     hitFade    = 0;
     boldFont   = hudSkin.label.font;
     normalFont = hudSkin.font;
     GameObject[] titans = GameObject.FindGameObjectsWithTag("Titan");
     foreach (GameObject tit in titans)
     {
         if (tit.GetComponent <Titan>().owner == Unit.Side.Player)
         {
             playerTitan = tit.GetComponent <Titan>();
         }
         else
         {
             enemyTitan = tit.GetComponent <Titan>();
         }
     }
 }
Ejemplo n.º 18
0
    // Use this for initialization
    void Awake()
    {
        Playstate   = this;
        playerUnits = new List <Unit>();
        enemyUnits  = new List <Unit>();

        GameObject[] titans = GameObject.FindGameObjectsWithTag("Titan");
        foreach (GameObject tit in titans)
        {
            if (tit.GetComponent <Titan>().owner == Unit.Side.Player)
            {
                playerTitan = tit.GetComponent <Titan>();
            }
            else
            {
                enemyTitan = tit.GetComponent <Titan>();
            }
        }
        winCam.enabled  = false;
        lossCam.enabled = false;
    }
Ejemplo n.º 19
0
        private Titan FindNearestEnemy()
        {
            Titan nearestEnemy    = null;
            float nearestDistance = 0;

            foreach (var enemyFaction in titan.Faction.EnemyFactions)
            {
                foreach (var enemyTitan in enemyFaction.Units)
                {
                    if (enemyTitan == null || !enemyTitan.IsAlive)
                    {
                        continue;
                    }
                    var distance = Vector3.Distance(titan.Position, enemyTitan.Position);
                    if (nearestEnemy == null || distance < nearestDistance)
                    {
                        nearestEnemy    = enemyTitan;
                        nearestDistance = distance;
                    }
                }
            }
            return(nearestEnemy);
        }
Ejemplo n.º 20
0
 public void OnRemoveTitan(Titan titan)
 {
 }
Ejemplo n.º 21
0
 public Titan_CircleAroundState(FiniteStateMachine stateMachine, Entity entity, string animationName, Titan titan) : base(stateMachine, entity, animationName)
 {
     this.titan = titan;
 }
Ejemplo n.º 22
0
    // Use this for initialization
    void Awake()
    {
        Playstate=this;
        playerUnits = new List<Unit>();
        enemyUnits= new List<Unit>();

        GameObject[] titans = GameObject.FindGameObjectsWithTag("Titan");
        foreach (GameObject tit in titans){

            if(tit.GetComponent<Titan>().owner==Unit.Side.Player){
                playerTitan = tit.GetComponent<Titan>();
            }else{
                enemyTitan = tit.GetComponent<Titan>();
            }
        }
        winCam.enabled=false;
        lossCam.enabled=false;
    }
Ejemplo n.º 23
0
    // Use this for initialization
    void Start()
    {
        logic = GameObject.Find ("Logic").GetComponent<Logic> ();
        hitFade = 0;
        boldFont = hudSkin.label.font;
        normalFont = hudSkin.font;
        GameObject[] titans = GameObject.FindGameObjectsWithTag("Titan");
        foreach (GameObject tit in titans){

            if(tit.GetComponent<Titan>().owner==Unit.Side.Player){
                playerTitan = tit.GetComponent<Titan>();
            }else{
                enemyTitan = tit.GetComponent<Titan>();
            }
        }
    }
Ejemplo n.º 24
0
 private ModuleSlot FindEmptySlot(Titan titan)
 {
     return(Titan.ModuleSlots.FirstOrDefault(slot => slot.Module == null));
 }
Ejemplo n.º 25
0
 public override void OnStateEnter()
 {
     enemy = FindNearestEnemy();
 }
Ejemplo n.º 26
0
 private void Initialize(Titan titan)
 {
     CameraController.SetViewToTitan(titan.Position);
     isInitialized = true;
 }
Ejemplo n.º 27
0
 public KillAllEnemiesState(TitanAI ai, Planet controlPlanet) : base(ai)
 {
     titan  = ai.Titan;
     planet = controlPlanet;
 }
Ejemplo n.º 28
0
 void Start()
 {
     titan = GetComponentInParent<Titan>();
 }
Ejemplo n.º 29
0
 public void OnAttach(Titan titan)
 {
     titan.AddParams(data);
 }
Ejemplo n.º 30
0
 public void OnDetach(Titan titan)
 {
     titan.RemoveParams(data);
 }
Ejemplo n.º 31
0
 public Titan_AoeAttackState(FiniteStateMachine stateMachine, Entity entity, string animationName, Titan titan) : base(stateMachine, entity, animationName)
 {
     this.titan = titan;
 }
Ejemplo n.º 32
0
 public Titan_WalkState(FiniteStateMachine stateMachine, Entity entity, string animationName, Data_WalkState stateData, Titan titan) : base(stateMachine, entity, animationName, stateData)
 {
     this.titan = titan;
 }
Ejemplo n.º 33
0
 public void Setup()
 {
     robin  = new Robin();
     hulkjr = new ChicoBestia();
     raven  = new Raven();
 }