Inheritance: PlayerPhysics
Ejemplo n.º 1
0
        public void MovePlayer(Arrows arrow)
        {
            switch (arrow)
            {
            case Arrows.left:
                player.Image = Properties.Resources.Character_left;
                moving.Move(-step, 0);
                break;

            case Arrows.right:
                player.Image = Properties.Resources.Character_right;
                moving.Move(step, 0);
                break;

            case Arrows.up:
                player.Image = Properties.Resources.Character_up;
                moving.Move(0, -step);
                break;

            case Arrows.down:
                player.Image = Properties.Resources.Character_down;
                moving.Move(0, step);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 2
0
        public void ReloadQuiver()
        {
            int index = Inventory.FindIndex(f => f.GetType() == typeof(Arrows));

            if (index != -1)
            {
                Arrows arrows = Inventory[index] as Arrows;
                arrows.LoadPlayerQuiverWithArrows(this);
                OutputHelper.Display.StoreUserOutput(
                    Settings.FormatSuccessOutputText(),
                    Settings.FormatDefaultBackground(),
                    "You reloaded your quiver.");
                if (arrows.Quantity == 0)
                {
                    Inventory.RemoveAt(index);
                }
            }
            else
            {
                OutputHelper.Display.StoreUserOutput(
                    Settings.FormatFailureOutputText(),
                    Settings.FormatDefaultBackground(),
                    "You don't have any arrows!");
            }
        }
Ejemplo n.º 3
0
    public void ShowArrow(Arrows id = 0)
    {
        switch (id)
        {
        case Arrows.ShowBoth:
            Arrow1.gameObject.SetActive(true);
            Arrow2.gameObject.SetActive(true);
            break;

        case Arrows.ShowOne:
            Arrow1.gameObject.SetActive(true);
            Arrow2.gameObject.SetActive(false);
            break;

        case Arrows.ShowTwo:
            Arrow1.gameObject.SetActive(false);
            Arrow2.gameObject.SetActive(true);
            break;

        case Arrows.ShowNone:
            Arrow1.gameObject.SetActive(false);
            Arrow2.gameObject.SetActive(false);
            break;

        default:
            goto case Arrows.ShowNone;
        }
    }
Ejemplo n.º 4
0
        public void gain_stats(Dictionary <TactileLibrary.Boosts, int> boosts)
        {
            Glow_Timer = 0;
            Timer      = STAT_GAIN_TIME;
            Arrows.Clear();
            Stat_Gains.Clear();
            Swirls.Clear();

            foreach (KeyValuePair <TactileLibrary.Boosts, int> pair in boosts)
            {
                Vector2 loc;
                if (pair.Key == TactileLibrary.Boosts.Con)
                {
                    loc = new Vector2(16 + ((((int)Stat_Labels.Con) / 4) * SPACING()), (((int)Stat_Labels.Con) % 4) * 16);
                }
                else
                {
                    loc = new Vector2(16 + ((((int)pair.Key) / 4) * SPACING()), ((((int)pair.Key) % 4) * 16));
                }

                Stat_Gains.Add(new Quick_Stat_Up_Num(new List <Texture2D> {
                    Global.Content.Load <Texture2D>(@"Graphics/Fonts/" + Config.PROMOTION_STAT_FONT),
                    Global.Content.Load <Texture2D>(@"Graphics/Fonts/" + Config.LEVEL_STAT_FONT)
                }));
                Stat_Gains[Stat_Gains.Count - 1].value = pair.Value;
                Stat_Gains[Stat_Gains.Count - 1].loc   = loc + new Vector2(40, 23);
                Arrows.Add(new Stat_Change_Arrow());
                Arrows[Arrows.Count - 1].texture = Global.Content.Load <Texture2D>(@"Graphics/Pictures/" + Stat_Change_Arrow.FILENAME);
                Arrows[Arrows.Count - 1].loc     = loc + new Vector2(32, 1);
                ((Stat_Change_Arrow)Arrows[Arrows.Count - 1]).update(0);
                Swirls.Add(new Stat_Up_Spark());
                Swirls[Swirls.Count - 1].loc = loc + new Vector2(-5, -7);
                Swirls[Swirls.Count - 1].update();
            }
        }
Ejemplo n.º 5
0
        public ArrowControl CreateArrow(ViewModel.Relationship viewModelRelationship)
        {
            if (viewModelRelationship.From == Guid.Empty || viewModelRelationship.To == Guid.Empty)
            {
                return(null);
            }



            if (Arrows.ContainsKey(viewModelRelationship.Id))
            {
                return(null);
            }
            if (IsArrowExist(viewModelRelationship.From, viewModelRelationship.To))
            {
                return(null);
            }
            var fromControl = NodeFactory.FindNodeControl(viewModelRelationship.From);
            var toControl   = NodeFactory.FindNodeControl(viewModelRelationship.To);

            if (fromControl == null || toControl == null)
            {
                PendingRelationships[viewModelRelationship.Id] = viewModelRelationship;
                return(null);
            }



            var set = CreateSet(viewModelRelationship, fromControl, toControl);

            Arrows[viewModelRelationship.Id] = set;
            return(set.Control);
        }
Ejemplo n.º 6
0
 public void cancel_stats_gain()
 {
     Timer = 0;
     Arrows.Clear();
     Stat_Gains.Clear();
     Swirls.Clear();
 }
Ejemplo n.º 7
0
        public void PlayerMove(Arrows arrow)
        {
            switch (arrow)
            {
            case Arrows.left:
                bomber.Image = Properties.Resources.moveleft;
                moving.Move(-step, 0);
                break;

            case Arrows.right:
                bomber.Image = Properties.Resources.moveright;
                moving.Move(step, 0);
                break;

            case Arrows.up:
                bomber.Image = Properties.Resources.bomber;
                moving.Move(0, -step);
                break;

            case Arrows.down:
                bomber.Image = Properties.Resources.bomber;
                moving.Move(0, step);
                break;

            default:
                break;
            }
        }
Ejemplo n.º 8
0
 public static Arrows Turn(this Arrows arrow, bool facingLeft)
 {
     if (arrow == Arrows.Up || arrow == Arrows.Neutral || arrow == Arrows.Down)
     {
         return(arrow);
     }
     if (arrow == Arrows.Left)
     {
         return(facingLeft ? arrow : Arrows.Right);
     }
     if (arrow == Arrows.UpLeft)
     {
         return(facingLeft ? arrow : Arrows.UpRight);
     }
     if (arrow == Arrows.DownLeft)
     {
         return(facingLeft ? arrow : Arrows.DownRight);
     }
     if (arrow == Arrows.Right)
     {
         return(facingLeft ? arrow : Arrows.Left);
     }
     if (arrow == Arrows.UpRight)
     {
         return(facingLeft ? arrow : Arrows.UpLeft);
     }
     return(facingLeft ? arrow : Arrows.DownLeft);
 }
Ejemplo n.º 9
0
 public void Setup()
 {
     _arrowsName        = "arrows";
     _arrowsMaxQuantity = 50;
     _arrows            = new Arrows(_arrowsName, 15, ArrowType.Standard);
     _player            = new Player("test", PlayerClassType.Archer);
 }
Ejemplo n.º 10
0
        public string GetRow()
        {
            var sb = new StringBuilder();

            sb.Append(Name); sb.Append('\t');
            sb.Append(Plural1); sb.Append('\t');
            if (Creature.HasSecondPlural)
            {
                sb.Append(Plural2); sb.Append('\t');
            }
            sb.Append(PriceLumber.ToString()); sb.Append('\t');
            sb.Append(PriceMercury.ToString()); sb.Append('\t');
            sb.Append(PriceOre.ToString()); sb.Append('\t');
            sb.Append(PriceSulphur.ToString()); sb.Append('\t');
            sb.Append(PriceCrystals.ToString()); sb.Append('\t');
            sb.Append(PriceGems.ToString()); sb.Append('\t');
            sb.Append(PriceGold.ToString()); sb.Append('\t');
            sb.Append(FightValue.ToString()); sb.Append('\t');
            sb.Append(AIValue.ToString()); sb.Append('\t');
            sb.Append(Growth.ToString()); sb.Append('\t');
            sb.Append(hordeGrowth.ToString()); sb.Append('\t');
            sb.Append(HP.ToString()); sb.Append('\t');
            sb.Append(Speed.ToString()); sb.Append('\t');
            sb.Append(Attack.ToString()); sb.Append('\t');
            sb.Append(Defense.ToString()); sb.Append('\t');
            sb.Append(LoDamage.ToString()); sb.Append('\t');
            sb.Append(HiDamage.ToString()); sb.Append('\t');
            sb.Append(Arrows.ToString()); sb.Append('\t');
            sb.Append(Spells.ToString()); sb.Append('\t');
            sb.Append(low.ToString()); sb.Append('\t');
            sb.Append(high.ToString()); sb.Append('\t');
            sb.Append(Description.ToString()); sb.Append('\t');
            sb.Append(attributes.ToString());
            return(sb.ToString());
        }
Ejemplo n.º 11
0
    private void Reset()
    {
        arrows = GetComponentInChildren <Arrows>();
        canvas = GetComponentInChildren <CharacterCanvas>();

        SetSettings(settings);
        SetColor(color);
    }
    void Start()
    {
        arrows = new Arrows();

        DisappearInputField.GetComponentInChildren <Text>().text  = Arrows.arrowTiming + "";
        EndSetInputField.GetComponentInChildren <Text>().text     = Arrows.setTiming + "";
        OriginSizeInputField.GetComponentInChildren <Text>().text = Arrows.originThreshold * 100 + "";
    }
Ejemplo n.º 13
0
 public void MoveHero(Arrows arrow)
 {
     if (hero == null)
     {
         return;
     }
     hero.MoveHero(arrow);
 }
Ejemplo n.º 14
0
    /// <summary> Update the UI for rotation </summary>
    public void UpdateRotationFields()
    {
        Vector3 rotation = Arrows.Engine2UI(EditorGeneral.current_movable.Rotation);

        xrot.value = rotation.x / 360 + .5f;
        yrot.value = rotation.y / 360 + .5f;
        zrot.value = rotation.z / 360 + .5f;
    }
Ejemplo n.º 15
0
 //Движения персонажа
 public void PlayerMove(Arrows arrow)
 {
     if (bomber == null)
     {
         return;
     }
     bomber.PlayerMove(arrow);
 }
Ejemplo n.º 16
0
 public void MovePlayer(Arrows arrow)
 {
     if (player == null)
     {
         return;
     }
     player.MovePlayer(arrow);
 }
Ejemplo n.º 17
0
 public Arrow GetArrow()
 {
     if (Arrows.Count == 0)
     {
         OnNoArrowPop(Arrows);
         return(null);
     }
     return(Arrows.Pop());
 }
Ejemplo n.º 18
0
 // Use this for initialization
 void Start()
 {
     gate         = GameObject.FindGameObjectWithTag("MapGate");
     sgm          = gate.GetComponent <SignalGeneratorMap>();
     gateCollider = GameObject.FindGameObjectWithTag("GateCollider");
     sc           = GetComponent <SceneControl>();
     arrow        = GameObject.FindGameObjectWithTag("ExitArrows");
     arrows       = arrow.GetComponent <Arrows>();
 }
Ejemplo n.º 19
0
        public IEnumerable <ArrowControlFactorySet> Clear()
        {
            foreach (ArrowControlFactorySet set in Arrows.Values)
            {
                yield return(set);
            }

            Arrows.Clear();
        }
Ejemplo n.º 20
0
        public void IncludeView(NodeView nextNode)
        {
            Status = NodeStatus.InCycle;
            var edge = Arrows.FirstOrDefault(a => a.EndNode.Equals(nextNode));

            if (edge != null)
            {
                edge.Status = NodeStatus.InCycle;
            }
        }
Ejemplo n.º 21
0
 /// <summary> Should be called, if the angular velocity is changed </summary>
 public void UpdateAngularVelocity()
 {
     try {
         EditorGeneral.current_movable.AngularVelocity = Arrows.UI2Engine(InputAngularVelocity);
     } catch (FormatException) {
         EditorGeneral.Throw("Illegal angular velocity input");
     } catch (NullReferenceException) {
         EditorGeneral.Throw("Nothing Selected");
     }
 }
Ejemplo n.º 22
0
 /// <summary> Should be called, if the rotation is changed </summary>
 public void UpdateRot()
 {
     try {
         EditorGeneral.current_movable.Rotation = Arrows.UI2Engine(InputRotation);
     } catch (FormatException) {
         EditorGeneral.Throw("Illegal rotation input");
     } catch (NullReferenceException) {
         EditorGeneral.Throw("Nothing Selected");
     }
 }
Ejemplo n.º 23
0
 private void Awake()
 {
     arrows          = GameObject.FindGameObjectWithTag("Arrows").GetComponent <Arrows>();
     maincam         = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <Camera>();
     inspector       = GameObject.Find("inspector").GetComponent <Inspector>();
     active          = this;
     current_movable = null;
     mainV           = GameObject.Find("Canvas").GetComponent <Canvas>();
     storyV          = GameObject.Find("StoryCanvas").GetComponent <Canvas>();
     StoryView       = false;
 }
Ejemplo n.º 24
0
 void Start()
 {
     //Finding objects with specific tags for easier differentiation
     Door = GameObject.FindGameObjectWithTag("Door");
     song = GameObject.FindGameObjectWithTag("Audio");
     //Getting components of other scripts
     anim           = GetComponent <Animator>();
     control        = GetComponent <playerController1>();
     characterBlink = GetComponent <Blink>();
     arrows         = GetComponent <Arrows>();
 }
Ejemplo n.º 25
0
 /// <inheritdoc />
 protected override void UnloadContent()
 {
     Primitive.Dispose();
     Arrows.ForEach(arrow => arrow.Dispose());
     Arrows.Clear();
     Primitive.Dispose();
     FullScreenQuad.Dispose();
     Effect.Dispose();
     DebugTextureEffect.Dispose();
     base.UnloadContent();
 }
Ejemplo n.º 26
0
        public void Update()
        {
            map.UpDate();
            MEvent Event;

            while ((Event = map.NextEvent()) != null)
            {
                if (Event.Type == MEvents.PlayerArrow)
                {
                    int TagArrow  = ((MEventArrowHit)Event).TagArrow;
                    int TagPlayer = ((MEventArrowHit)Event).TagPlayer;
                    players[TagPlayer].recieveDamage(Arrows[TagArrow].dmg);
                    if (players[TagPlayer].isDead())
                    {
                        if (ArenaPlayer.ContainsKey(Arrows[TagArrow].creater))
                        {
                            ArenaPlayer[Arrows[TagArrow].creater].AddKill();
                        }
                        ArenaPlayer[TagPlayer].AddDeath();
                        if (players[TagPlayer].rightHand != 1)
                        {
                            int NewTag = Utily.GetTag();
                            Drops.Add(NewTag, new ADrop(1, players[TagPlayer].rightHand));
                            map.SpawnDrops(NewTag, map.players[TagPlayer].x, map.players[TagPlayer].y);
                        }
                        map.SpawnPlayer(TagPlayer);
                        players[TagPlayer].respawn();
                    }
                    Arrows.Remove(TagArrow);
                }
                if (Event.Type == MEvents.PlayerDrop)
                {
                    var drop = Drops[((MEventDrop)Event).TagDrop];
                    players[((MEventDrop)Event).TagPlayer].pickedUpItem(drop.id, drop.Count);
                    Drops.Remove(((MEventDrop)Event).TagDrop);
                    if (((MEventDrop)Event).BySpawner)
                    {
                        DropForRespawn.Enqueue(Utily.MakePair <long, int>(timer.ElapsedMilliseconds, ((MEventDrop)Event).NumSpawner));
                    }
                }
                if (Event.Type == MEvents.DestroyArrow)
                {
                    Arrows.Remove(((MEventDestroyArrow)Event).TagArrow);
                }
            }
            while (DropForRespawn.Count > 0 && DropForRespawn.Peek().Item1 + WaitRespawnDrop < timer.ElapsedMilliseconds)
            {
                int num = DropForRespawn.Dequeue().Item2;
                int tag = Utily.GetTag();
                map.SpawnDrops(num, tag);
                Drops.Add(tag, new ADrop(map.dropSpawners[num].count, map.dropSpawners[num].id));
            }
        }
Ejemplo n.º 27
0
        private void Shoot()
        {
            var arrow = new Arrow(Game, Position);

            Arrows.Add(arrow);
            arrow.LoadContent(Game.Content, "Arrow");
            arrow.Position          = Position;
            arrow.Direction         = Rotation;
            arrow.RotationInRadians = new Vector3(Rotation.X, Rotation.Y, Rotation.Z);
            //    arrow.Direction.Normalize();
            arrow.Fire(ArrowForce);
        }
Ejemplo n.º 28
0
    /// <summary> Update the UI for the position </summary>
    public void UpdatePositionFileds()
    {
        if (EditorGeneral.current_movable == null)
        {
            return;
        }
        Vector3 position = Arrows.Engine2UI(EditorGeneral.current_movable.Position);

        xpos.text = position.x.ToString();
        ypos.text = position.y.ToString();
        zpos.text = position.z.ToString();
    }
Ejemplo n.º 29
0
        internal SelectionState saveState()
        {
            SelectionState state = new SelectionState();

            state.SelectedItems  = Objects.Clone();
            state.SelectedBoxes  = Boxes.Clone();
            state.SelectedTables = Tables.Clone();
            state.SelectedArrows = Arrows.Clone();
            state.SelectedHosts  = ControlHosts.Clone();
            state.ActiveItem     = flowChart.ActiveObject;

            return(state);
        }
Ejemplo n.º 30
0
        public ArrowControlFactorySet RemoveArrow(Guid relationshipId)
        {
            ArrowControlFactorySet set = null;

            if (Arrows.ContainsKey(relationshipId))
            {
                set = Arrows[relationshipId];
                Arrows.Remove(relationshipId);
                set.Control.UnlinkRelatedNodeControls();
            }

            return(set);
        }
Ejemplo n.º 31
0
 /**
  * Methods
  */
 void Start()
 {
     _messages = e_DriveMessages;
     _arrow = e_ArrowToShow;
 }
Ejemplo n.º 32
0
 // ---------------------------------------
 // Arrow Keys
 // ---------------------------------------
 public static string Arrow(OnOff isSet, Arrows dir) {
   return string.Format(Esc + "{0}{1}", (isSet == OnOff.On ? "O" : ""), Convert.ToChar(65 + (int) dir));
 }
Ejemplo n.º 33
0
    // ArrayList Item;  // For Items
    // Use this for initialization
    void Start()
    {
        // Set the transform and the position of the unit
        tr = transform;
        pos = tr.position;
        oldPos = pos;

        plannedPath = new char[agility];

        // Get the needed scripts script
        arrowScript = (Arrows) tr.GetChild (1).GetComponent( "Arrows" );
        anima = (Animator) tr.GetComponent ("Animator");
        gridScript = (GridController) GameObject.Find ("GridMaster").GetComponent("GridController");

        speed = Random.Range (1, 99);
    }
Ejemplo n.º 34
0
    // -----------------------------------------------------------------------
    #endregion Constructors




    public static string Cursor(int x, Arrows dir) {
      return string.Format(Esc + "[{0};{1}", x, Convert.ToChar(65 + (int) dir));
    }
Ejemplo n.º 35
0
        public static void SendSaveArrow(int itemNum, Arrows.Arrow arrow)
        {
            TcpPacket packet = new TcpPacket("savearrow");

            packet.AppendParameters(
                itemNum.ToString(),
                arrow.Name,
                arrow.Pic.ToString(),
                arrow.Range.ToString(),
                arrow.Amount.ToString()
                );

            packet.FinalizePacket();

            SendPacket(packet);
        }