public bool PickUpWeapons(GameObject munition)
    {
        int i;

        for (i = 6; i < 11; i++)
        {
            if (munitions.Items[i] == -1)
            {
                break;
            }
        }
        if (i == 11)
        {
            return(false);
        }
        for (i = 6; i < 11; i++)
        {
            if (munitions.Items[i] == -1)
            {
                munitions.Items[i]  = munition.GetComponent <Item>().itemValues.number;
                munitions.stacks[i] = 1;
                break;
            }
        }
        Arms.GetComponent <ArmsDepiction>().Update2(i - 6);
        return(true);
    }
Exemple #2
0
        public void init()
        {
            //make sure nao is ready to move
            try
            {
                rp = new RobotPostureProxy(ip, 9559);
                rp.goToPosture("StandZero", 1);

                Console.WriteLine("Connected to Nao with IP: " + ip);
            }
            catch (Exception)
            {
                throw new Exception("Cannot connect to Proxy");
            }

            try
            {
                mp = new MotionProxy(ip, port);
            }
            catch (Exception)
            {
                throw new Exception("Cannot connect to Proxy");
            }


            Arms RArm = new Arms();
        }
Exemple #3
0
	// Use this for initialization
	void Start () {
		hasTorso = false;
		arm = GetComponent<Arms> ();
		leg = GetComponent<LegObject> ();
		sprRend = GetComponent<SpriteRenderer> ();
		player = GameObject.Find ("ROLLINGHEAD_0").transform;
	}
    void Start()
    {
        inventory = Arms.instance;
        inventory.onItemChanhgedCallback += UpdateUI;

        slots = itemsParent.GetComponentsInChildren <ShopSlot>();
    }
Exemple #5
0
        protected Unit(GameInstance instance, UnitRecord unitRecord)
        {
            GameInstance = instance;

            Id   = unitRecord.Id;
            Team = unitRecord.User?.Team ?? 0;
            Name = unitRecord.Name;

            Head    = new Part(unitRecord.Head, this);
            Chest   = new Part(unitRecord.Chest, this);
            Arms    = new Arms(unitRecord.Arms, this);
            Legs    = new Part(unitRecord.Legs, this);
            Booster = new Part(unitRecord.Backpack, this);

            var left  = CreateWeapon(unitRecord.WeaponSet1Left, ArmIndex.Left, WeaponSetIndex.Primary);
            var right = unitRecord.WeaponSet1Right != null
                ? CreateWeapon(unitRecord.WeaponSet1Right, ArmIndex.Right, WeaponSetIndex.Primary)
                : new NullWeapon(this, ArmIndex.Right, WeaponSetIndex.Primary);

            WeaponSetPrimary = (left, right);

            left  = CreateWeapon(unitRecord.WeaponSet2Left, ArmIndex.Left, WeaponSetIndex.Secondary);
            right = unitRecord.WeaponSet2Right != null
                ? CreateWeapon(unitRecord.WeaponSet2Right, ArmIndex.Right, WeaponSetIndex.Secondary)
                : new NullWeapon(this, ArmIndex.Right, WeaponSetIndex.Secondary);

            WeaponSetSecondary = (left, right);
        }
Exemple #6
0
    //读取数据
    public static PlayerData LoadPlayer()
    {
        string path = Application.persistentDataPath + "/player.fun";

        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(path, FileMode.Open);
            PlayerData      data      = formatter.Deserialize(stream) as PlayerData;
            stream.Close();

            return(data);
        }
        else
        {
            PlayerData data = new PlayerData();
            for (int i = 0; i < 1; i++)
            {
                Arms a = new Arms("arms" + i, "0010");
                data.AllArms.Add(a);
            }

            SaveSystem.SavePlayer(data);
            Debug.LogWarning("Save file not found in  " + path + ", Create a new data");
            return(data);
        }
    }
Exemple #7
0
    public void Equip(Equipment equipment)
    {
        if (equipment == null)
        {
            return;
        }

        switch (equipment.Type)
        {
        case TypeEquip.Armor:
            Armor newArmor = equipment as Armor;
            EquipArmor(newArmor);
            break;

        case TypeEquip.Arms:
            Arms newArms = equipment as Arms;
            EquipWeapon(newArms);
            break;

        case TypeEquip.Shoes:
            Shoes newShoes = equipment as Shoes;
            EquipShoes(newShoes);
            break;
        }
    }
Exemple #8
0
 protected override void EquipWeapon(Arms newArms)
 {
     racialScores[arms.RacialTrait]--;
     base.EquipWeapon(newArms);
     racialScores[arms.RacialTrait]++;
     UpdateRace();
 }
Exemple #9
0
        static void Main(string[] args)
        {
            Console.WriteLine("Введите название оружия: ");
            String arms = Console.ReadLine();

            Factory factory = new Factory();

            switch (arms)
            {
            case "Brt92FS":
            {
                Arms brt92FS = factory.create(arms);
                brt92FS.Shooting();

                break;
            }

            case "Glock18":
            {
                Arms glock18 = factory.create(arms);
                glock18.Shooting();
                break;
            }

            case "Ak47":
            {
                Arms ak47 = factory.create(arms);
                ak47.Shooting();
                break;
            }
            }
        }
Exemple #10
0
    private void CreateArm(FireType type)
    {
        switch (type)
        {
        case FireType.Straight:
            curArms = new Straight(FirePoint, account);
            break;

        case FireType.HighSpeed:
            curArms = new HighSpeed(FirePoint, account);
            break;

        case FireType.Shotgun:
            curArms = new Shotgun(FirePoint, account);
            break;

        case FireType.Flare:
            curArms = new Flare(FirePoint, account);
            break;

        default:
            break;
        }
        fireInterval        = curArms.FireInterval;
        defaultFireInterval = curArms.FireInterval;
    }
    public override string ToString()
    {
        if (Head == null || Torso == null || Arms.Count < 2 || Legs.Count < 2)
        {
            return("We need more parts!");
        }
        long totalEnergy = 0;

        totalEnergy += Head.EnergyConsumption;
        totalEnergy += Torso.EnergyConsumption;
        totalEnergy += Arms.Select(s => long.Parse(s.EnergyConsumption.ToString())).Sum();
        totalEnergy += Legs.Select(s => long.Parse(s.EnergyConsumption.ToString())).Sum();

        if (totalEnergy > Energy)
        {
            return("We need more power!");
        }
        StringBuilder result = new StringBuilder();

        result = result.Append("Jarvis:\n")
                 .Append(Head.ToString())
                 .Append(Torso.ToString());
        foreach (var item in Arms.OrderBy(s => s.EnergyConsumption))
        {
            result = result.Append(item.ToString());
        }
        foreach (var item in Legs.OrderBy(s => s.EnergyConsumption))
        {
            result = result.Append(item.ToString());
        }
        return(result.ToString());
    }
Exemple #12
0
        public override string ToString()
        {
            if (RoboHead == null || RoboTorso == null || Arms.Count < 2 || Legs.Count < 2)
            {
                return("We need more parts!");
            }
            long TotalEnergy = 0L;

            TotalEnergy  = RoboHead.EnergyConsumption + RoboTorso.EnergyConsumption;
            TotalEnergy += Arms.Select(p => p.EnergyConsumption).Sum();
            TotalEnergy += Legs.Select(p => p.EnergyConsumption).Sum();
            if (Energy < TotalEnergy)
            {
                return("We need more power!");
            }
            StringBuilder sb = new StringBuilder();

            sb.Append("Jarvis:\n\r");
            sb.Append(RoboHead.ToString());
            sb.Append(RoboTorso.ToString());
            sb.Append(Arms[0].ToString());
            sb.Append(Arms[1].ToString());
            sb.Append(Legs[0].ToString());
            sb.Append(Legs[1].ToString());
            return(sb.ToString());
        }
Exemple #13
0
        public ActionResult DeleteConfirmed(int id)
        {
            Arms arms = db.Arms.Find(id);

            db.Arms.Remove(arms);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #14
0
 // Use this for initialization
 void Start()
 {
     hasTorso = false;
     arm      = GetComponent <Arms> ();
     leg      = GetComponent <LegObject> ();
     sprRend  = GetComponent <SpriteRenderer> ();
     player   = GameObject.Find("ROLLINGHEAD_0").transform;
 }
Exemple #15
0
 void Start()
 {
     curArms  = new Straight(FirePoint, account);
     fireType = FireType.Straight;
     if (IsLocalPlayer)
     {
         StartCoroutine(Attack());
     }
 }
Exemple #16
0
 public void Awake()
 {
     if (instance != null)
     {
         Debug.LogWarning("More than one instance of Inventory found!");
         return;
     }
     instance = this;
 }
Exemple #17
0
 virtual public bool Take(Arms arms)                                                        //返回是否操作成功
 {
     if (CharacterAttribute.GetInstance().ArmsGemGroove[(int)arms].getLeftGrooveNum() <= 0) //是否有空出的槽
     {
         return(false);
     }
     attachArms = arms;
     return(true);
 }   //佩戴
Exemple #18
0
 // Use this for initialization
 void Start()
 {
     hasTorso = false;
     arm = GetComponent<Arms>();
     leg = GetComponent<LegObject>();
     sprRend = GetComponent<SpriteRenderer>();
     sprRend.sprite = head;
     player = GameObject.Find("Player").transform;
 }
Exemple #19
0
 // Use this for initialization
 void Start()
 {
     hasTorso       = false;
     arm            = GetComponent <Arms>();
     leg            = GetComponent <LegObject>();
     sprRend        = GetComponent <SpriteRenderer>();
     sprRend.sprite = head;
     player         = GameObject.Find("Player").transform;
 }
Exemple #20
0
        void itemImgSetter(int val, string imgPath)
        {
            switch (val)
            {
            case 0:
                Gun1.Load(imgPath);
                break;

            case 1:
                Gun2.Load(imgPath);
                break;

            case 2:
                Gun3.Load(imgPath);
                break;

            case 3:
                Head.Load(imgPath);
                break;

            case 4:
                Arms.Load(imgPath);
                break;

            case 5:
                Chest.Load(imgPath);
                break;

            case 6:
                Legs.Load(imgPath);
                break;

            case 7:
                ClassArmour.Load(imgPath);
                break;

            case 8:
                Ghost.Load(imgPath);
                break;

            case 9:
                Sparrow.Load(imgPath);
                break;

            case 10:
                Ship.Load(imgPath);
                break;

            case 11:
                SubClass.Load(imgPath);
                break;

            case 13:
                Embelm.Load(imgPath);
                break;
            }
        }
Exemple #21
0
    private void colorSprites()
    {
        if (beltLess)
        {
            Belt.SetActive(false);
        }

        Color skincol = colorMe(SkinColor);

        Eyes.GetComponent <blink>().eyesClosed     = skincol;
        Head.GetComponent <SpriteRenderer>().color = skincol;
        Arms.GetComponent <SpriteRenderer>().color = skincol;

        if (bareFoot)
        {
            setColor(Feet, skincol);
        }
        else
        {
            setColor(Feet, colorMe(ShoesColor));
        }

        if (Shirtless)
        {
            setColor(Body, skincol);
        }
        else
        {
            setColor(Body, new Color(Random.Range(0.3f, 0.7f), Random.Range(0.3f, 0.7f), Random.Range(0.3f, 0.7f)));
        }

        if (Pantsless)
        {
            setColor(Pants, skincol);
        }
        else
        {
            setColor(Pants, colorMe(PantsColor));
        }

        if (hairless)
        {
            setColor(Hair, new Color(0, 0, 0, 0));
        }
        else
        {
            setColor(Hair, colorMe(HairColor));
        }

        setColor(Nose, colorMe(NoseColor));

        Color eyescol = colorMe(EyeColor);

        setColor(Eyes, eyescol);
        Eyes.GetComponent <blink>().eyesOpen = eyescol;
    }
Exemple #22
0
 void Start()
 {
     torso        = GetComponent <Torso>();
     leg          = GetComponent <LegObject>();
     arm          = GetComponent <Arms>();
     myAnimator   = GetComponent <Animator>();
     myController = GetComponent <Controller2D>();
     gravity      = -(2 * jumpHeight) / Mathf.Pow(timeToJumpApex, 2);
     jumpVelocity = Mathf.Abs(gravity * timeToJumpApex);
 }
Exemple #23
0
 void Start()
 {
     torso = GetComponent<Torso>();
     leg = GetComponent<LegObject>();
     arm = GetComponent<Arms>();
     myAnimator = GetComponent<Animator>();
     myController = GetComponent<Controller2D>();
     gravity = -(2 * jumpHeight) / Mathf.Pow(timeToJumpApex, 2);
     jumpVelocity = Mathf.Abs(gravity * timeToJumpApex);
 }
Exemple #24
0
	// Use this for initialization
	void Start () {
		arm = GetComponent<Arms> ();
		body = GetComponent<Torso> ();
		oneLeg = false;
		twoLegs = false;
		legCount = 0;
		player = GameObject.Find ("ROLLINGHEAD_0").transform;
		sprRend = GetComponent<SpriteRenderer> ();
		goWithTag = new GameObject[100];
	}
Exemple #25
0
 /**
  * 人物攻击
  * */
 public virtual void Attack(Transform transform)
 {
     Debug.Log("攻击");
     if (currnetArm != null)
     {
         Debug.Log("当前武器攻击");
         Arms arm = currnetArm.GetComponent <Arms>();   //获取当前武器上的component
         arm.Attack(transform);                         //调用component中的攻击方法
     }
 }
Exemple #26
0
        static void Main(string[] args)
        {
            Console.WriteLine("Let's assemble a Lego character!");
            Console.WriteLine('\n');



            var head = new Head()
            {
                Name = "Mr. Lego"
            };

            Console.WriteLine('\n');


            head.Hair = "green";

            Console.WriteLine($"Without {head.Name}'s hat, his {head.Hair} hair danced in the wind.");

            head.MagnifyVision(true);
            Console.WriteLine('\n');



            var torso = new Torso()
            {
            };

            Console.WriteLine('\n');


            Parts.Torso.haveExtraSupplies(true);
            Console.WriteLine('\n');



            var arms = new Arms();

            Console.WriteLine('\n');


            Console.WriteLine($"{head.Name} asked...");
            arms.UseArms("rectangular");
            Console.WriteLine('\n');


            var legs = new Legs()
            {
            };

            Console.WriteLine('\n');

            Console.WriteLine($"He looked down at his {legs._legColor} legs.");
            legs.Walk("stubby");
        }
        public void FilterAndJoin()
        {
            //filter subjects by arms
            if (Arms.Any())
            {
                Subjects = Subjects.FindAll(s => Arms.Select(a => a.Id).Contains(s.StudyArmId)).ToList();
            }

            Debug.WriteLine(Subjects.Count, " AFTER ARMS");

            //filter subjects by studies
            if (Studies.Any())
            {
                Subjects = Subjects.FindAll(subj => Studies.Select(st => st.Id).Contains(subj.StudyId)).ToList();
            }
            Debug.WriteLine(Subjects.Count, " AFTER Studies");

            //filter subjects by subCharacteristics
            if (SubjChars.Any())
            {
                Subjects = Subjects.FindAll(s => SubjChars.Select(sc => sc.SubjectId).Contains(s.Id)).ToList();
            }
            Debug.WriteLine(Subjects.Count, " AFTER SubjChars");

            //filter by visits
            //TODO

            //TODO : WILL RETRIEVE SUBJECTS THAT HAVE SAME UNIQUE IDS ACROSS PROJECTS  (i.e. need to load observations to Mongo with
            //TODO: DB subjectId
            //filter observations for filtered subjects
            Observations = Observations?.FindAll(o => Subjects.Select(s => s.UniqueSubjectId).Contains(o.USubjId));

            //filter subjects by selected observations
            if (Observations.Any() && ObservationsFiltered)
            {
                Subjects = Subjects.FindAll(s => Observations.Select(o => o.USubjId).Contains(s.UniqueSubjectId));
            }
            Debug.WriteLine(Subjects.Count, " AFTER syncing with observations");

            //FILTER SAMPLES BY SELECTED AND FILTERED SAMPLE CHARACTERISTICS
            if (SampleCharacteristics.Any())
            {
                Samples = Samples.FindAll(s => SampleCharacteristics.Select(sc => sc.SampleId).Contains(s.Id)).ToList();
            }

            //TODO: TEMP FILTERING BY COLLECTION STUDY DAY


            //SYNCHRONIZE SAMPLES AND SUBJECTS
            if (Samples.Any())
            {
                Samples  = Samples.FindAll(s => Subjects.Select(sc => sc.Id).Contains(s.SubjectId)).ToList();
                Subjects = Subjects.FindAll(sb => Samples.Select(sp => sp.SubjectId).Contains(sb.Id)).ToList();
            }
        }
Exemple #28
0
    private void InsertUpdate()
    {
        Arms objArms = new Arms();

        objArms.ArmsId      = ID;
        objArms.ArmsName    = tbxName.Text;
        objArms.Description = tbxDescription.Text;
        new bllArms().InsertUpdate(objArms);
        new bllAudit().Insert("Setup", "InsertUpdate Arms", "Arms: " + tbxName.Text, User.Identity.Name);
        MessageController.Show("Saved successfully.", MessageType.Information, Page);
    }
Exemple #29
0
        public void ArmsPowerIsOneHundredAndFifty()
        {
            // Arrange
            var arms = new Arms();

            // Act
            var power = arms.Power();

            // Assert
            Assert.Equal(150, power);
        }
Exemple #30
0
 // Use this for initialization
 void Start()
 {
     arm       = GetComponent <Arms>();
     body      = GetComponent <Torso>();
     oneLeg    = false;
     twoLegs   = false;
     legCount  = 0;
     player    = GameObject.Find("Player").transform;
     sprRend   = GetComponent <SpriteRenderer>();
     goWithTag = new GameObject[100];
 }
 void Start()
 {
     controller  = GetComponent <CharacterController>();
     myTransform = transform;
     speed       = walkSpeed;
     rayDistance = controller.height * .5f + controller.radius;
     slideLimit  = controller.slopeLimit - .1f;
     jumpTimer   = antiBunnyHopFactor;
     arms        = GetComponentInChildren <Arms>();
     jumpSound   = GetComponent <AudioSource>();
 }
Exemple #32
0
 public ActionResult Edit([Bind(Include = "Arms_id,ArmsName,ArmsPicture,ArmsVideo,ArmsDes,ArmsSection_id,ArmsTechnical,BigSection_id,BigSection2_id,BigSection3_id,Manu,Stime,Ctime")] Arms arms)
 {
     if (ModelState.IsValid)
     {
         db.Entry(arms).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.ArmsSection_id = new SelectList(db.ArmsSection, "ArmsSection_id", "ArmsSectionName", arms.ArmsSection_id);
     return(View(arms));
 }
Exemple #33
0
 public void LoadAll()
 {
     Floors.LoadAll();
     Items.LoadAll();
     Creatures.LoadAll();
     Templates.LoadAll();
     Animations.LoadAll();
     Heads.LoadAll();
     Chests.LoadAll();
     Legs.LoadAll();
     Arms.LoadAll();
     Weapons.LoadAll();
     Shields.LoadAll();
 }
Exemple #34
0
    public void NewGame()
    {
        Sound();
        PlayerData data = new PlayerData();

        for (int i = 0; i < 1; i++)
        {
            Arms a = new Arms("arms" + i, "0010");
            data.AllArms.Add(a);
        }

        SaveSystem.SavePlayer(data);
        SceneManager.LoadScene("MenuScene");
    }