Inheritance: PlayerChar
コード例 #1
0
 public static void AddSorcerer(Character character)
 {
     Sorcerer.Base(character);
     Sorcerer.Features(character);
     Sorcerer.Equipment(character);
     character.Archetype = Sorcerer.SorcerousOrigin;
 }
コード例 #2
0
	// Update is called once per frame
	void FixedUpdate() {
		if(mainCamera == null || fighter == null || sorcerer == null){
			mainCamera = GameObject.FindGameObjectWithTag("MainCamera") as GameObject;;
			fighter = GameObject.FindObjectOfType(typeof(Fighter))as Fighter;
			sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer= GameObject.FindObjectOfType (typeof (Sorcerer))as Sorcerer;
		}
		else{
			Player player = (fighter.playerEnabled)? (Player) fighter : sorcerer;
			float distance = Vector3.Distance(mainCamera.transform.position,player.transform.position);
			RaycastHit[] hits = Physics.RaycastAll (mainCamera.transform.position, player.transform.position, distance,checkLayers);
			foreach (GameObject gO in invisibleList){
				gO.layer = LayerMask.NameToLayer(visibleLayerName);
			}
			invisibleList = new List<GameObject>();
			foreach(RaycastHit hit in hits){
				if(Vector3.Distance (mainCamera.transform.position,hit.collider.gameObject.transform.position)<distance){
					hit.collider.gameObject.layer = LayerMask.NameToLayer(invisibleLayerName);
					invisibleList.Add(hit.collider.gameObject);
				}
			}
//			foreach(GameObject gO in gameObjects){
//				if (gO == this.gameObject){
//					this.gameObject.layer = invisibleLayer.value;
//				}
//				else{
//					this.gameObject.layer = visibleLayer.value;
//					}
//			}
		}
		
	}
コード例 #3
0
        public AllSpells(string classStr)
        {
            Stat = "Cha";
            switch (classStr)
            {
            case "Cleric":
                Cleric.Add(0, ClericSpells.Cantrips);
                Cleric.Add(1, ClericSpells.FirstLvls);
                Cleric.Add(2, ClericSpells.SecondLvls);
                Cleric.Add(3, ClericSpells.ThirdLvls);
                Cleric.Add(4, ClericSpells.FourthLvls);
                Cleric.Add(5, ClericSpells.FifthLvls);
                Cleric.Add(6, ClericSpells.SixthLvls);
                Cleric.Add(7, ClericSpells.SeventhLvls);
                Cleric.Add(8, ClericSpells.EigthLvls);
                Cleric.Add(9, ClericSpells.NinthLvls);
                break;

            case "Sorcerer":
                Sorcerer.Add(0, SorcererSpells.Cantrips);
                Sorcerer.Add(1, SorcererSpells.FirstLvls);
                Sorcerer.Add(2, SorcererSpells.SecondLvls);
                Sorcerer.Add(3, SorcererSpells.ThirdLvls);
                Sorcerer.Add(4, SorcererSpells.FourthLvls);
                Sorcerer.Add(5, SorcererSpells.FifthLvls);
                Sorcerer.Add(6, SorcererSpells.SixthLvls);
                Sorcerer.Add(7, SorcererSpells.SeventhLvls);
                Sorcerer.Add(8, SorcererSpells.EigthLvls);
                Sorcerer.Add(9, SorcererSpells.NinthLvls);
                break;
            }
        }
コード例 #4
0
	// Use this for initialization
	void Start () {

		subscribeToSorcererInstancePublisher (); // jump into game

		fighter = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer = (Sorcerer) GameObject.FindObjectOfType (typeof (Sorcerer));
	}
コード例 #5
0
        public void LoadSorcerers(Sorcerer sorcerer)
        {
            var sorcererTexture = _content.Load <Texture2D>("Sorcerer/sorcerer_attack");

            sorcerer.LoadAllFrames(
                CharacterAction.Fight,
                sorcererTexture,
                numberOfColumns: 10,
                numberOfRows: 1,
                dimensions: new Vector2(200, 200));

            sorcererTexture = _content.Load <Texture2D>("Sorcerer/sorcerer_slide");

            sorcerer.LoadAllFrames(
                CharacterAction.Walk,
                sorcererTexture,
                numberOfColumns: 8,
                numberOfRows: 7,
                dimensions: new Vector2(100, 100));

            sorcererTexture = _content.Load <Texture2D>("Sorcerer/sorcerer_die");

            sorcerer.LoadAllFrames(
                CharacterAction.Die,
                sorcererTexture,
                numberOfColumns: 4,
                numberOfRows: 4,
                dimensions: new Vector2(100, 100));
        }
コード例 #6
0
        public Character CreateCharacter(CharacterType profesionType)
        {
            Character character = null;

            switch (profesionType)
            {
            case CharacterType.Druid:
                character = new Druid();
                break;

            case CharacterType.Sorcerer:
                character = new Sorcerer();
                break;

            case CharacterType.Paladin:
                character = new Paladin();
                break;

            case CharacterType.Knight:
                character = new Knight();
                break;

            case CharacterType.Gnome:
                character = new Gnome();
                break;

            case CharacterType.Cyclops:
                character = new Cyclops();
                break;
            }

            return(character);
        }
コード例 #7
0
	// Use this for initialization
	void Start () {
		Debug.Log ("Am i second?");
		fighter = (Fighter)GameObject.FindObjectOfType (typeof (Fighter));
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer ();
		fighter.transform.position = initialFighterPosition;
		sorcerer.transform.position = initialSorcererPosition;
		checkSorcererPosition();
	}
コード例 #8
0
	// Use this for initialization
	void Start () {
		fighter = GameObject.FindObjectOfType<Fighter> ();
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer ();
		idealRatio = maxHeight / maxDistance;
		height = maxHeight;
		distance = maxDistance;
		angle = 45f;
	}
コード例 #9
0
        public static void HandleAbnormalityEnd(S_ABNORMALITY_END p)
        {
            AbnormalityManager.EndAbnormality(p.TargetId, p.AbnormalityId);
            if (!SettingsManager.ClassWindowSettings.Enabled)
            {
                return;
            }

            switch (SessionManager.CurrentPlayer.Class)
            {
            case Class.Archer:
                Archer.CheckFocusEnd(p);
                Archer.CheckSniperEyeEnd(p);
                break;

            case Class.Warrior:
                Warrior.CheckBuffEnd(p);
                break;

            case Class.Lancer:
                Lancer.CheckLineHeldEnd(p);
                Lancer.CheckArushEnd(p);
                Lancer.CheckGshoutEnd(p);
                break;

            case Class.Mystic:
                Mystic.CheckBuffEnd(p);
                break;

            case Class.Brawler:
                Brawler.CheckBrawlerAbnormalEnd(p);
                break;

            case Class.Ninja:
                Ninja.CheckFocusEnd(p);
                break;

            case Class.Priest:
                Priest.CheckBuffEnd(p);
                break;

            case Class.Sorcerer:
                Sorcerer.CheckBuffEnd(p);
                break;

            case Class.Reaper:
                Reaper.CheckBuffEnd(p);
                break;

            case Class.Slayer:
                Slayer.CheckBuffEnd(p);
                break;

            case Class.Berserker:
                Berserker.CheckBuffEnd(p);
                break;
            }
        }
コード例 #10
0
        public void GivenASorcererLevel_KnownSpellArrayIsReturned(int level, int[] expectedSpells)
        {
            PlayerClass player = new Sorcerer();

            player.AssignLevel(level);
            player.GetClassKnownSpells();
            int[] actual = player.Magic.SpellsKnown;
            Assert.AreEqual(expectedSpells, actual);
        }
コード例 #11
0
	// Use this for initialization
	void Update () {
		if(!trial){
			fighter = (Fighter)GameObject.FindObjectOfType (typeof (Fighter));
			sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer ();
			fighter.transform.position = initialFighterPosition;
			sorcerer.transform.position = initialSorcererPosition;
			trial = true;
		}
	}
コード例 #12
0
        private void Sorcerer2_Click(object sender, RoutedEventArgs e)
        {
            //MessageBox.Show("Sorcerer");
            this.Hide();
            Sorcerer sorcerer = new Sorcerer();

            sorcerer.ShowDialog();
            this.Show();
        }
コード例 #13
0
	// Use this for initialization
	void Start () {

		subscribeToSorcererInstancePublisher (); // jump into game

		fPosition = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
		sPosition = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sPosition = (Sorcerer) GameObject.FindObjectOfType (typeof (Sorcerer));
		fPosition.transform.position = fInitial;
		sPosition.transform.position = sInitial;
	}
コード例 #14
0
ファイル: Class.cs プロジェクト: Jmwhite45/RPG-Projects
        private static string[] getSubClassDnD(CLASSES C, int lv)
        {
            string[] Sub = new string[20];// may need to change temp size

            if (C == BARBARIAN)
            {
                Sub = Barbarian.getDnD(lv);
            }
            else if (C == BARD)
            {
                Sub = Bard.getDnD();
            }
            else if (C == CLERIC)
            {
                Sub = Cleric.getDnD(D5Core);
            }
            else if (C == DRUID)
            {
                Sub = Druid.getDnD(D5Core);
            }
            else if (C == FIGHTER)
            {
                Sub = Fighter.getDnD(D5Core, lv);
            }
            else if (C == MONK)
            {
                Sub = Monk.getDnD(D5Core, lv);
            }
            else if (C == PALADIN)
            {
                Sub = Paladin.getDnD(D5Core);
            }
            else if (C == RANGER)
            {
                Sub = Ranger.getDnD(D5Core, lv);
            }
            else if (C == ROGUE)
            {
                Sub = Rogue.getDnD(D5Core);
            }
            else if (C == SORCERER)
            {
                Sub = Sorcerer.getDnD(D5Core, lv);
            }
            else if (C == WARLOCK)
            {
                Sub = Warlock.getDnD(D5Core, lv);
            }
            else if (C == WIZARD)
            {
                Sub = Wizard.getDnD(D5Core);
            }

            Sub = Vars.shorten <string>(Sub);

            return(Sub);
        }
コード例 #15
0
	void startAI(){
		if(checkAIPlayingStatus()){
			fighter = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
			sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer = (Sorcerer) GameObject.FindObjectOfType (typeof (Sorcerer));
			setAISkillSet();
			nearestEnemy = checkNearestEnemy();
			timeOut = basicTimeOutReset;
			status = false;
		}
	}
コード例 #16
0
 public static void RegenerateMana(this Sorcerer sorcerer, int mana)
 {
     if (sorcerer.ManaPoints + mana > sorcerer.MaximumManaPoints)
     {
         sorcerer.ManaPoints = sorcerer.MaximumManaPoints;
     }
     else
     {
         sorcerer.ManaPoints += mana;
     }
 }
コード例 #17
0
	// Use this for initialization
	void Start () {

		subscribeToSorcererInstancePublisher (); // jump into game

		transform.position = new Vector3 (transform.position.x, 0.5f, transform.position.z);
		originalSpawn = transform.position;
		
		timeToDestroy = 10f;
		
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // Sorcerer sorcerer = (Sorcerer) GameObject.FindObjectOfType (typeof (Sorcerer)) as Sorcerer;
		this.cycloneSkill = sorcerer.GetComponent<CycloneSkill>();
	}
コード例 #18
0
ファイル: MiniMap.cs プロジェクト: marouen-lamiri/Second-Soul
	void Start(){

		subscribeToSorcererInstancePublisher (); // jump into game

		fighter = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer = (Sorcerer) GameObject.FindObjectOfType (typeof (Sorcerer));
		target = (fighter.playerEnabled) ? (Player) fighter : sorcerer;
//		if(Network.isServer) {
//			buildMinimap ();
//		}

	}
コード例 #19
0
        public void Given_Then_Returned()
        {
            // Arrange
            PlayerClass pc = new Sorcerer();

            // Act
            pc.GetSpellDifficultyClass();
            int[] actual = pc.Magic.SpellDC;

            // Assert
            Assert.IsNull(actual);
        }
コード例 #20
0
        private void generateClass()
        {
            int randomNumber = NumberGen.gen(12);

            if (randomNumber == 0)
            {
                characterClass = new Barbarian();
            }
            else if (randomNumber == 1)
            {
                characterClass = new Bard();
            }
            else if (randomNumber == 2)
            {
                characterClass = new Cleric();
            }
            else if (randomNumber == 3)
            {
                characterClass = new Druid();
            }
            else if (randomNumber == 4)
            {
                characterClass = new Fighter();
            }
            else if (randomNumber == 5)
            {
                characterClass = new Monk();
            }
            else if (randomNumber == 6)
            {
                characterClass = new Paladin();
            }
            else if (randomNumber == 7)
            {
                characterClass = new Ranger();
            }
            else if (randomNumber == 8)
            {
                characterClass = new Rogue();
            }
            else if (randomNumber == 9)
            {
                characterClass = new Sorcerer();
            }
            else if (randomNumber == 10)
            {
                characterClass = new Warlock();
            }
            else if (randomNumber == 11)
            {
                characterClass = new Wizard();
            }
        }
コード例 #21
0
ファイル: UnitTest1.cs プロジェクト: lgagomes/CharUtil
        public void TestCharismaModifier()
        {
            // Arrange
            Sorcerer sorcerer = new Sorcerer("sorcerer");

            // Act
            sorcerer.Charisma             = 14;
            sorcerer.KeyAttributeModifier = sorcerer.GetModifier(sorcerer.Charisma);

            // Assert
            Assert.Equal(2, sorcerer.KeyAttributeModifier);
        }
コード例 #22
0
	// Use this for initialization
	void Start () {

		subscribeToSorcererInstancePublisher (); // jump into game
		fighter= GameObject.FindObjectOfType(typeof(Fighter))as Fighter;
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer= GameObject.FindObjectOfType (typeof (Sorcerer))as Sorcerer;
		if(mainCamera == null){
			mainCamera = GameObject.FindGameObjectWithTag("MainCamera") as GameObject;
		}
		invisibleList = new List<GameObject>();
		visibleLayerName = "Structure";
		invisibleLayerName = "unwalkable";
	}
コード例 #23
0
        public static void HandleAbnormalityRefresh(S_ABNORMALITY_REFRESH p)
        {
            AbnormalityManager.BeginAbnormality(p.AbnormalityId, p.TargetId, p.Duration, p.Stacks);
            if (!SettingsManager.ClassWindowSettings.Enabled)
            {
                return;
            }
            switch (SessionManager.CurrentPlayer.Class)
            {
            case Class.Warrior:
                Warrior.CheckBuff(p);
                break;

            case Class.Archer:
                Archer.CheckFocus(p);
                Archer.CheckFocusX(p);
                Archer.CheckSniperEye(p);
                break;

            case Class.Lancer:
                Lancer.CheckLineHeld(p);
                break;

            case Class.Priest:
                Priest.CheckBuff(p);
                break;

            case Class.Mystic:
                Mystic.CheckBuff(p);
                break;

            case Class.Sorcerer:
                Sorcerer.CheckBuff(p);
                break;

            case Class.Reaper:
                Reaper.CheckBuff(p);
                break;

            case Class.Slayer:
                Slayer.CheckBuff(p);
                break;

            case Class.Berserker:
                Berserker.CheckBuff(p);
                break;

            case Class.Brawler:
                Brawler.CheckBrawlerAbnormal(p);
                break;
            }
        }
コード例 #24
0
ファイル: CharCreator.cs プロジェクト: Aetherys/IT-1050
        public Character ReadClass(int archetype, string wrmc)
        {
            int choice;
            Character player;

            MyTTY.Show("The following " + wrmc + " are available to you:\n\n");

            switch (archetype)
            {
                case 1:
                    MyTTY.Show("1) Knight\n");
                    MyTTY.Show("2) Berserker\n");
                    break;

                case 2:
                    MyTTY.Show("1) Hunter\n");
                    MyTTY.Show("2) Assassin\n");
                    break;

                case 3:
                    MyTTY.Show("1) Sorcerer\n");
                    MyTTY.Show("2) Warlock\n");
                    break;

                case 4:
                    MyTTY.Show("1) Priest\n");
                    MyTTY.Show("2) Druid\n");
                    break;
            }

            choice = MyTTY.ReadIntLimit("\nEnter the number of your selection: ", 2);

            switch (archetype)
            {
                case 1:
                    if (choice < 2) player = new Knight(); else player = new Berserker();
                    break;
                case 2:
                    if (choice < 2) player = new Hunter(); else player = new Assassin();
                    break;
                case 3:
                    if (choice < 2) player = new Sorcerer(); else player = new Warlock();
                    break;
                case 4:
                    if (choice < 2) player = new Priest(); else player = new Druid();
                    break;
                default:
                    player = null;
            }

            return player;
        }
コード例 #25
0
	void Awake(){

		subscribeToSorcererInstancePublisher (); // jump into game

		mapGenerationCompleted = false;
		if (Network.isServer){
			fighter = (Fighter)GameObject.FindObjectOfType (typeof (Fighter));
			sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer = (Sorcerer)GameObject.FindObjectOfType (typeof (Sorcerer));
			mapArray = generateMap(mapSizeX, mapSizeZ, numberRooms, fighter.gameObject, sorcerer.gameObject);
			buildMap(mapArray);
			mapGenerationCompleted = true; // signal for client network to set the sorcerer's position with rpc call
		}
	}
コード例 #26
0
	public void readPrimaryStats(){
		if(fighter == null) {
			fighter = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
		}
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer = (Sorcerer) GameObject.FindObjectOfType (typeof (Sorcerer));
		sorcerer.setIntelligence((int) PlayerPrefs.GetInt("Intelligence"));
		sorcerer.setWisdom((int) PlayerPrefs.GetInt("Wisdom"));
		sorcerer.setSpirit((int) PlayerPrefs.GetInt("Spirit"));
		sorcerer.calculateNewPrimaryStats();
		sorcerer.calculateSecondaryStats();
		sorcerer.calculateLevel();
		sorcerer.calculateNextLevelXP();
	}
コード例 #27
0
ファイル: Grid.cs プロジェクト: marouen-lamiri/Second-Soul
	void Start(){

		subscribeToSorcererInstancePublisher (); // jump into game

		nodeDiameter = nodeRadius*2;
		gridSizeX = Mathf.RoundToInt(gridWorldSize.x/nodeDiameter); 
		gridSizeY = Mathf.RoundToInt(gridWorldSize.y/nodeDiameter); 
		createGrid();
		Fighter fighter = GameObject.FindObjectOfType(typeof(Fighter))as Fighter;
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // Sorcerer sorcerer = GameObject.FindObjectOfType (typeof (Sorcerer))as Sorcerer;
		fighter.setGrid (this);
		sorcerer.setGrid (this);
	}
コード例 #28
0
        public void CreatePlayerClass(string playerClass)
        {
            switch (playerClass)
            {
            case "Barbarian":
                PlayerClass = new Barbarian();
                break;

            case "Bard":
                PlayerClass = new Bard();
                break;

            case "Cleric":
                PlayerClass = new Cleric();
                break;

            case "Druid":
                PlayerClass = new Druid();
                break;

            case "Fighter":
                PlayerClass = new Fighter();
                break;

            case "Monk":
                PlayerClass = new Monk();
                break;

            case "Paladin":
                PlayerClass = new Paladin();
                break;

            case "Ranger":
                PlayerClass = new Ranger();
                break;

            case "Rogue":
                PlayerClass = new Rogue();
                break;

            case "Sorcerer":
                PlayerClass = new Sorcerer();
                break;

            case "Wizard":
                PlayerClass = new Wizard();
                break;
            }
        }
コード例 #29
0
ファイル: Program.cs プロジェクト: bigboyTaysh/DragonHunt
        static void Main(string[] args)
        {
            Console.ForegroundColor = ConsoleColor.White;

            List <Character> characters = new List <Character>();
            Sorcerer         sorcerer1  = new Sorcerer("Sorcerer1");
            Sorcerer         sorcerer2  = new Sorcerer("Sorcerer2");

            Paladin paladin1 = new Paladin("Paladin1");
            Paladin paladin2 = new Paladin("Paladin2");

            Knight knight1 = new Knight("Knight1");
            Knight knight2 = new Knight("Knight2");

            characters.Add(sorcerer1);
            characters.Add(sorcerer2);
            characters.Add(paladin1);
            characters.Add(paladin2);
            characters.Add(knight1);
            characters.Add(knight2);

            Dragon dragon = new Dragon
            {
                Name             = "Dragon",
                Level            = 1,
                ExperiencePoints = 0,
                Strength         = 20,
                Dexternity       = 20,
                Intelligence     = 20,
                MaximumHitPoints = 300,
                Damage           = 50,
                Defense          = 50
            };

            dragon.OnBreatheFire += v => characters.ForEach(k => k.TakeDamage(v));

            dragon.BreatheFire();

            paladin1.IncreaseExperience(50);
            MyExtensions.IncreaseExperience(paladin2, 50);

            var under1Level = characters.Where(v => v.Level > 1).Select(v => new { v.Name, v.Level });

            foreach (var item in under1Level)
            {
                Console.WriteLine($"Imię: {item.Name}, {item.Level}");
            }
        }
コード例 #30
0
        static void Main(string[] args)
        {
            var sorcerer = new Sorcerer(new ElementsImmunityPoisonVulnerability());
            var knight   = new Knight(new DefoultHitBehavior());
            var ogre     = new Ogre(new DefoultHitBehavior());

            sorcerer.EquipWeapon(new Firebolt());
            knight.EquipWeapon(new Sword());
            ogre.EquipWeapon(new Club());


            Fight(sorcerer, ogre);
            Console.WriteLine();

            Console.ReadKey();
        }
コード例 #31
0
        public Character CreateCharacter(charactertype type)
        {
            Character character = null;

            if (type.Equals(charactertype.orc)) {
                character = new Orc();
            }
            else if (type.Equals(charactertype.sorcerer)) {
                character = new Sorcerer();
            }
            else if (type.Equals(charactertype.townperson)) {
                character = new TownPerson();
            }
            else if (type.Equals(charactertype.warrior)) {
                character = new Warrior();
            }
            return character;
        }
コード例 #32
0
ファイル: Forest.cs プロジェクト: marouen-lamiri/Second-Soul
	// Use this for initialization
	void Start () {

		subscribeToSorcererInstancePublisher (); // jump into game

		fPosition = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
		sPosition = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sPosition = (Sorcerer) GameObject.FindObjectOfType (typeof (Sorcerer));
		if(Application.levelCount - 1 == previousSceneTown){
			magicCircle = GameObject.Find(circleTown);
			fPosition.transform.position = magicCircle.transform.position + new Vector3(6,0,6);
			sPosition.transform.position = magicCircle.transform.position + new Vector3(5,0,5);
		}
		else{
			Debug.Log (Application.levelCount - 1);
			magicCircle2 = GameObject.Find(circleDungeon);
			fPosition.transform.position = magicCircle2.transform.position + new Vector3(6,0,6);
			sPosition.transform.position = magicCircle2.transform.position + new Vector3(5,0,5);
		}
	}
コード例 #33
0
        public void TestUpdateKnownSpells()
        {
            // Arrange
            Sorcerer sorcerer = new Sorcerer()
            {
                CharacterLevel = 1
            };

            int[] spellsKnownSorcerer = new int[]   { 4, 2, 0, 0, 0, 0, 0, 0, 0, 0 };

            try
            {
                // Act
                sorcerer.CurrentKnownSpells = _spellsRepository.GetSpellsSlots(sorcerer.ClassName, sorcerer.CharacterLevel, "KnownSpells");

                // Assert
                Assert.Equal(spellsKnownSorcerer, sorcerer.CurrentKnownSpells);
            }
            catch { }
        }
コード例 #34
0
    public void Awake()
    {
        BDice[] party = new BDice[3];
        party[0] = new Warrior("Hiro", 10, ETargetType.Ally);
        party[1] = new Cleric("Jason", 10, ETargetType.Ally);
        party[2] = new Sorcerer("Harry", 6, ETargetType.Ally);

        BDice[] enemy = new BDice[3];
        enemy[0] = new GoblinWarrior("Snarlie", "Warrior", 8, ETargetType.Enemy);
        enemy[1] = new GoblinWarrior("Toothless", "Warrior", 8, ETargetType.Enemy);
        enemy[2] = new GoblinSorcerer("Wizzie", "Sorcerer", 5, ETargetType.Enemy);

        //for (int x = 0; x < 3; x++)
        //{
        //    party[x] = new AllNoneGuy("Nonnie Jim", "None guy", 10, ETargetType.Ally);
        //    enemy[x] = new AllNoneGuy("Nonnie Jane", "None guy", 10, ETargetType.Enemy);
        //}

        //party[0].CurrentHealth = 5;

        for (int x = 0; x < party.Length; x++)
        {
            party[x].DiceObject           = CombatManager.Instance.PartyDiceObjects[x];
            party[x].DiceObject.diceModel = party[x];
            party[x].OnDead              += party[x].DiceObject.OnDeath;
            party[x].OnDead              += CombatManager.Instance.HandleDeath;
            enemy[x].DiceObject           = CombatManager.Instance.EnemyDiceObjects[x];
            enemy[x].DiceObject.diceModel = enemy[x];
            enemy[x].OnDead              += enemy[x].DiceObject.OnDeath;
            enemy[x].OnDead              += CombatManager.Instance.HandleDeath;
        }

        CombatManager.Instance.PlayersModels = party;
        CombatManager.Instance.EnemysModels  = enemy;
        CombatManager.Instance.ActivePlayerModels.AddRange(party);
        CombatManager.Instance.ActiveEnemyModels.AddRange(enemy);

        MenuManager.Instance.CurrentState = MenuManager.Instance.States[0];

        TurnManager.Instance.AI = MenuManager.Instance.gameObject.AddComponent <EasyAI>();
    }
コード例 #35
0
        public void TestSorcererSpellsPerDay()
        {
            // Arrange
            Sorcerer sorcerer = new Sorcerer()
            {
                CharacterLevel = 10
            };

            int[] SpellsPerDaySorcerer = new int[] { 6, 6, 6, 6, 5, 3, 0, 0, 0, 0 };

            try
            {
                // Act
                sorcerer.CurrentDailySpells =
                    _spellsRepository.GetSpellsSlots(sorcerer.ClassName, sorcerer.CharacterLevel, "DailySpells");

                // Assert
                Assert.Equal(SpellsPerDaySorcerer, sorcerer.CurrentDailySpells);
            }
            catch { }
        }
コード例 #36
0
        public Character CreateCharacter(charactertype type)
        {
            Character character = null;

            if (type.Equals(charactertype.orc))
            {
                character = new Orc();
            }
            else if (type.Equals(charactertype.sorcerer))
            {
                character = new Sorcerer();
            }
            else if (type.Equals(charactertype.townperson))
            {
                character = new TownPerson();
            }
            else if (type.Equals(charactertype.warrior))
            {
                character = new Warrior();
            }
            return(character);
        }
コード例 #37
0
    // Start is called before the first frame update
    void Start()
    {
        Ogre   ogre   = new Ogre();
        Goblin goblin = new Goblin();

        Sorcerer    sorcerer    = new Sorcerer();
        Warrior     warrior     = new Warrior();
        Necromancer necromancer = new Necromancer();

        Debug.Log("//////////////////////////////");
        ogre.Bash();
        ogre.Retreat();
        ogre.DisplayStatus();
        ogre.Move();

        Debug.Log("//////////////////////////////");
        goblin.ThrowBombs();
        goblin.Retreat();
        goblin.DisplayStatus();
        goblin.Move();

        Debug.Log("//////////////////////////////");
        sorcerer.DisplayStats();
        sorcerer.CastFireball();
        sorcerer.CastIceStorm();
        sorcerer.Move();

        Debug.Log("//////////////////////////////");
        warrior.DisplayStats();
        warrior.Whirlewind();
        warrior.Cleave();
        warrior.Move();

        Debug.Log("//////////////////////////////");
        necromancer.DisplayStats();
        necromancer.SummonSkeleton();
        necromancer.Drainlife();
        necromancer.Move();
    }
コード例 #38
0
ファイル: UnitTest1.cs プロジェクト: lgagomes/CharUtil
        public void TestSorcererSpellsPerDay()
        {
            // Arrange
            Sorcerer sorcerer = new Sorcerer("sorcerer");

            int[,] SpellsPerDaySorcerer = new int[20, 10] {
                { 5, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 6, 4, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 6, 5, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 6, 6, 3, 0, 0, 0, 0, 0, 0, 0 },
                { 6, 6, 4, 0, 0, 0, 0, 0, 0, 0 },
                { 6, 6, 5, 3, 0, 0, 0, 0, 0, 0 },
                { 6, 6, 6, 4, 0, 0, 0, 0, 0, 0 },
                { 6, 6, 6, 5, 3, 0, 0, 0, 0, 0 },
                { 6, 6, 6, 6, 4, 0, 0, 0, 0, 0 },
                { 6, 6, 6, 6, 5, 3, 0, 0, 0, 0 },
                { 6, 6, 6, 6, 6, 4, 0, 0, 0, 0 },
                { 6, 6, 6, 6, 6, 5, 3, 0, 0, 0 },
                { 6, 6, 6, 6, 6, 6, 4, 0, 0, 0 },
                { 6, 6, 6, 6, 6, 6, 5, 3, 0, 0 },
                { 6, 6, 6, 6, 6, 6, 6, 4, 0, 0 },
                { 6, 6, 6, 6, 6, 6, 6, 5, 3, 0 },
                { 6, 6, 6, 6, 6, 6, 6, 6, 4, 0 },
                { 6, 6, 6, 6, 6, 6, 6, 6, 5, 3 },
                { 6, 6, 6, 6, 6, 6, 6, 6, 6, 4 },
                { 6, 6, 6, 6, 6, 6, 6, 6, 6, 6 }
            };

            try
            {
                // Act
                sorcerer.UpdateSpellsPerDay();

                // Assert
                Assert.Equal(SpellsPerDaySorcerer, sorcerer.DailySpells);
            }
            catch { }
        }
コード例 #39
0
ファイル: UnitTest1.cs プロジェクト: lgagomes/CharUtil
        public void TestUpdateKnownSpells()
        {
            // Arrange
            Sorcerer sorcerer = new Sorcerer("sorcerer");

            int[,] spellsKnownSorcerer = new int[20, 10] {
                { 4, 2, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 5, 2, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 5, 3, 0, 0, 0, 0, 0, 0, 0, 0 },
                { 6, 3, 1, 0, 0, 0, 0, 0, 0, 0 },
                { 6, 4, 2, 0, 0, 0, 0, 0, 0, 0 },
                { 7, 4, 2, 1, 0, 0, 0, 0, 0, 0 },
                { 7, 5, 3, 2, 0, 0, 0, 0, 0, 0 },
                { 8, 5, 3, 2, 1, 0, 0, 0, 0, 0 },
                { 8, 5, 4, 3, 2, 0, 0, 0, 0, 0 },
                { 9, 5, 4, 3, 2, 1, 0, 0, 0, 0 },
                { 9, 5, 5, 4, 3, 2, 0, 0, 0, 0 },
                { 9, 5, 5, 4, 3, 2, 1, 0, 0, 0 },
                { 9, 5, 5, 4, 4, 3, 2, 0, 0, 0 },
                { 9, 5, 5, 4, 4, 3, 2, 1, 0, 0 },
                { 9, 5, 5, 4, 4, 4, 3, 2, 0, 0 },
                { 9, 5, 5, 4, 4, 4, 3, 2, 1, 0 },
                { 9, 5, 5, 4, 4, 4, 3, 3, 2, 0 },
                { 9, 5, 5, 4, 4, 4, 3, 3, 2, 1 },
                { 9, 5, 5, 4, 4, 4, 3, 3, 3, 2 },
                { 9, 5, 5, 4, 4, 4, 3, 3, 3, 3 }
            };

            try
            {
                // Act
                sorcerer.UpdateKnownSpells();

                // Assert
                Assert.Equal(spellsKnownSorcerer, sorcerer.KnownSpells);
            }
            catch { }
        }
コード例 #40
0
ファイル: Enemy.cs プロジェクト: marouen-lamiri/Second-Soul
	protected void enemyStart(){
		
		characterStart ();
		sphere.renderer.material.color = Color.red;
		grid = (Grid)GameObject.FindObjectOfType (typeof(Grid));
		pathing = (PathFinding)GameObject.FindObjectOfType (typeof(PathFinding));
		experienceBase = 25;
		xpGiven = false;
		lootGiven = false;
		lootFactory = GameObject.FindObjectOfType<LootFactory> ();
		
		// networking: makes sure each enemy is properly instantiated even on another game instance that didn't run the EnemyFactory code.
		target = (Fighter) GameObject.FindObjectOfType (typeof (Fighter)); // for the enemies perspective target is always fighter
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sorcerer = (Sorcerer) GameObject.FindObjectOfType (typeof (Sorcerer));

		
		level = target.level;
		initializePrimaryStats();
		initializeSecondaryStatsBase();
		initializeSecondaryStats();
		calculateSecondaryStats();
		health = maxHealth;
		energy = maxEnergy;
		
		activeSkill1 = (BasicMelee)GetComponent<BasicMelee>();

		
		this.transform.parent = GameObject.Find("Enemies").transform;

		// networking:
		enemyNetworkScript = (EnemyNetworkScript)GetComponent<EnemyNetworkScript> ();
		
		collider = GetComponent<CapsuleCollider>();
		wanderScript = GetComponent<Wander> ();
		arriveScript = GetComponent<Arrive> ();
	}
コード例 #41
0
ファイル: Enemy.cs プロジェクト: marouen-lamiri/Second-Soul
	// ------- for jump into game: ----------
	public void updateMySorcerer(Sorcerer newSorcerer) {
		this.sorcerer = newSorcerer;
	}
コード例 #42
0
	// Use this for initialization

	void Start () {
		fighter = GameObject.FindObjectOfType<Fighter> ();
		sorcerer = GameObject.FindObjectOfType<Sorcerer> ();
		mobRadius = 3;
	}
コード例 #43
0
    void Awake()
    {
        switch (PlayerStatus.playerData.characterNumber)
        {
        case 0:
            // 青年を出す処理を書く
            break;

        case 1:
            // ムキムキを出す
            player = PhotonNetwork.Instantiate("Player/mukimuki", new Vector3(PlayerStatus.playerData.x, PlayerStatus.playerData.y, PlayerStatus.playerData.z), Quaternion.identity, 0);
            break;

        case 2:
            // 少女を出す
            break;

        case 3:
            // BBAを出す
            break;
        }

        // 職業によって処理分け
        switch (PlayerStatus.playerData.job)
        {
        // アーチャー
        case 0:
            // アーチャーを入れる
            Archer archer = player.AddComponent <Archer>();
            // PhotonViewの通信を使うリストにアーチャーを登録する
            player.GetComponent <PhotonView>().ObservedComponents.Add(archer);
            // アニメーションを変更する
            player.GetComponent <Animator>().runtimeAnimatorController = archerAnimationController;
            break;

        case 1:
            // ウォーリアを入れる
            Warrior warrior = player.AddComponent <Warrior>();
            // PhotonViewの通信を使うリストにアーチャーを登録する
            player.GetComponent <PhotonView>().ObservedComponents.Add(warrior);

            warrior.Initialize();

            Debug.Log(warrior.GetPlayerData().name);

            // アニメーションを変更する
            player.GetComponent <Animator>().runtimeAnimatorController = warriorAnimationController;
            break;

        case 2:
            // ソーサラーを入れる
            Sorcerer sorcerer = player.AddComponent <Sorcerer>();
            // PhotonViewの通信を使うリストにアーチャーを登録する
            player.GetComponent <PhotonView>().ObservedComponents.Add(sorcerer);
            // アニメーションを変更する
            player.GetComponent <Animator>().runtimeAnimatorController = sorcererAnimationController;
            break;

        case 3:
            // アーチャーを入れる
            Monk monk = player.AddComponent <Monk>();
            // PhotonViewの通信を使うリストにアーチャーを登録する
            player.GetComponent <PhotonView>().ObservedComponents.Add(monk);
            // アニメーションを変更する
            player.GetComponent <Animator>().runtimeAnimatorController = monkAnimationController;
            break;
        }
    }
コード例 #44
0
	public void Update() {
		
		// display chat window on enter:
		if(Input.GetKeyDown ("enter") || Input.GetKeyDown ("return")){ //if(Input.GetKeyDown ("n")){
			//displayChat = !displayChat;
			displayChat = true;
			framesCounterBeforeFadeOutChat = 0;
			//GUI.FocusControl(chatBoxGUIName); // not working here, has to be done in on GUI within if Network.isClient == true ... why?

			// for chat's textArea fade out: on Return / Entre key pressed, reset the transparency value to 1.
			chatTextAreaColor = new Color(defaultGUIBackgroundColor.r, defaultGUIBackgroundColor.g, defaultGUIBackgroundColor.b, 1.0f); // 1.0f;
			// reset counter for fade out to be done later:
			numberOfFramesAfterChatButtonsWereHiddenBecauseInactive = 0;
		}
		if(textFieldString != textFieldStringInPreviousFrame) {
			framesCounterBeforeFadeOutChat = 0;
			textFieldStringInPreviousFrame = textFieldString;
		}
		// hide when pressing escape:
		if(textFieldString.Contains(""+(char)27)) {
			displayChat = false;
		}
		
		// make chat control disappear after a few seconds, but keep the textarea:
		//print ("HAI --> "+GUI.GetNameOfFocusedControl());
		if(displayChat == true && framesCounterBeforeFadeOutChat < numberOfFramesToWaitBeforeFadingOutChat ) { // GUI.GetNameOfFocusedControl() != "ChatBox" --> not working !
			framesCounterBeforeFadeOutChat++;
		}
		else if(displayChat == true && framesCounterBeforeFadeOutChat >= numberOfFramesToWaitBeforeFadingOutChat) { //GUI.GetNameOfFocusedControl() != "ChatBox" --> working!
			displayChat = false;
		}

		// generate the map only after the players have been created (because they are needed for some reason for the map generation code:
		bool serverAndClientAreBothConnected = Network.connections.Length != 0; // 0 length means no connection, i.e. no client connected to server.
		if(serverAndClientAreBothConnected && Application.loadedLevelName == StartScreenOfficialSceneName && bothPlayerAndSorcererWereFound) {	// && Network.isServer

			if(Network.isServer) {
				framesToWait++;
				if(framesToWait > numberOfFramesToWaitBeforeServerLoadsGameScene) {
					Loading.show ();
					// load the game scene: the map and players (fighter and sorcerer) should be kept, using DontDestroyOnLoad
					NetworkLevelLoader.Instance.LoadLevel(gameSceneToLoad,1); //NetworkingCollaboration
				}

			} else {
				Loading.show ();
				NetworkLevelLoader.Instance.LoadLevel(gameSceneToLoad,1); //NetworkingCollaboration

			}
		}


		//===================
		// client --> logic for creating (different types of) sorcerer:
		if (SorcererInstanceManager.getSorcerer() == null) {// Application.loadedLevelName == StartScreenOfficialSceneName && !sorcererWasCreated) { //Network.isClient && 

			//  --> moved out of if(isClient), because we still want the server to be able to determine the sorcerer's type for 1 player mode.
			if(classChooser.sorcererSelectionStrings[classChooser.sorcererSelection]=="Mage"){
				//				sorcerer = (Sorcerer) Instantiate(classChooser.mage,Vector3.zero,Quaternion.identity);
				sorcererPrefab = classChooser.mage;
			}
			else if(classChooser.sorcererSelectionStrings[classChooser.sorcererSelection]=="Druid"){
				//				sorcerer = (Druid) Instantiate(classChooser.druid,Vector3.zero,Quaternion.identity);
				sorcererPrefab = classChooser.druid;
			}
			else/*(sorcererSelectionStrings[sorcererSelection]=="Priest")*/{
				//				sorcerer = (Priest) Instantiate(classChooser.priest,Vector3.zero,Quaternion.identity);
				sorcererPrefab = classChooser.priest;
			}

			// if player choose to play as Client, instantiate sorcerer:
			if(Network.isClient){
				transform.position = sorcererInitialPositionInStartMenu;
				// this is for the case: in start menu, first connection:
				SorcererInstanceManager.checkForNewSorcererNetworkInstantiatedByClient();
				SorcererInstanceManager.createAndSwapNewSorcerer(sorcererPrefab, this.transform); // 
				//Sorcerer sorcerer = (Sorcerer) Network.Instantiate(sorcererPrefab, transform.position, transform.rotation, 0) as Sorcerer; //as Sorcerer; // N.B. place the network game object exactly where you want to spawn players.
				sorcererWasCreated = true;
			}


		} 
		//debug:
		//		if(SorcererInstanceManager.getSorcerer() == null) {
		//			print ("sorcerer IS ABSENT, is null in sorcererInstanaceManager in update funciton.");
		//		} else {
		//			print ("sorcerer IS PRESENT, is NOT null in sorcererInstanaceManager in update funciton");
		//		}
			

		// ------------------
		// server --> logic for creating (different types of) fighter:
		if(Application.loadedLevelName == StartScreenOfficialSceneName && !playerWasCreated) { //Network.isServer && 

			// --> moved out of if(isServer), since we want the server to be able to set the type of fighter even before connecting as a server.
			if(classChooser.fighterSelectionStrings[classChooser.fighterSelection]=="Berserker"){
				//				fighter = (Berserker) Instantiate(classChooser.berserker,Vector3.zero,Quaternion.identity);
				playerPrefab = classChooser.berserker;
			}
			else if(classChooser.fighterSelectionStrings[classChooser.fighterSelection]=="Knight"){
				//				fighter = (Knight) Instantiate(classChooser.knight,Vector3.zero,Quaternion.identity);
				playerPrefab = classChooser.knight;
			}
			else/*(fighterSelectionStrings[fighterSelection]=="Monk")*/{
				//				fighter = (Monk) Instantiate(classChooser.monk,Vector3.zero,Quaternion.identity);
				playerPrefab = classChooser.monk;
			}

			// if player choose to play as Server, instantiate fighter:
			if(Network.isServer) {
				transform.position = fighterInitialPositionInStartMenu;
				Fighter fighter = (Fighter) Network.Instantiate(playerPrefab, transform.position, transform.rotation, 0) as Fighter; //as Fighter; // N.B. place the network game object exactly where you want to spawn players.
				playerWasCreated = true;
				
				lines = Network.Instantiate (linesPrefab,transform.position,transform.rotation,7)as GameObject;
			}
		}

		// =======================\
		// client and server --> logic for keeping fighter and sorcerer across scenes (dontdestroyonload):
		//if(Application.loadedLevelName == StartScreenOfficialSceneName) { //&& (Sorcerer)GameObject.FindObjectOfType(typeof(Sorcerer)).name != "Sorcerer"

			Sorcerer sorcerer2 = (Sorcerer)GameObject.FindObjectOfType (typeof (Sorcerer)); //sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // 
			Fighter fighter2 = (Fighter)GameObject.FindObjectOfType(typeof(Fighter));	

			//GameObject lines = GameObject.Find ("lines");
			if(lines != null){
				DontDestroyOnLoad(lines);
				lines.gameObject.layer = LayerMask.NameToLayer ("Minimap");
				lines.name = "lines";
			}
			GameObject lines2 = GameObject.Find ("lines(Clone)");
			if(Network.isClient && lines2 != null){

				DontDestroyOnLoad(lines2);
				lines2.gameObject.layer = LayerMask.NameToLayer ("Minimap");
				lines2.name = "lines";
			}
			
			if(sorcerer2 != null && fighter2 != null) {
				DontDestroyOnLoad (sorcerer2);
				DontDestroyOnLoad (fighter2);
				sorcerer2.name = "Sorcerer";
				fighter2.name = "Fighter";
				bothPlayerAndSorcererWereFound = true;
			}
			

		//}

		//=========================
		// server --> send 
		if (Network.isServer && MapGeneration.mapGenerationCompleted && !sorcererPositionWasSent) { // 
			OnSorcererPositionDeterminedAfterMapCreation(MapGeneration.playerStartPositionVector3);
			Sorcerer sorcerer = (Sorcerer)GameObject.FindObjectOfType (typeof (Sorcerer)); //sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); // 
			//sorcererPositionWasSent = true;
		}

	}
コード例 #45
0
        static void Main(string[] args)
        {
            {
/* Welkom bij Simple Adventure
 * Hier zie je een raamwerk van een text based rpg
 * De classes en subclasses zijn al aangemaakt, subclasses staan in de mapjes
 * Aan jou de taak om hier een invulling aan te geven!
 * Wat moet je laten zien:
 *  - Dat je OOP beheerst
 *  - Dat je inheritance beheerst
 *  - Dat je in staat bent om output naar de console te krijgen op basis van de classes
 *  - Het hoeft geen volledig spel te zijn, maar het moet iets doen en het moet werken
 *  - En natuurlijk op de juiste manier in elkaar zitten
 * Waar scoor ik bonuspunten mee:
 *  - Gebruik polymorphism d.m.v. virtual methods en/of verschillende constructors (bijvoorbeeld subclasses)
 *  - Je hebt een speelbare game gemaakt
 *  - Je hebt zinvolle en werkende uitbreidingen gemaakt op het raamwerk
 * Kwaliteit gaat boven kwantiteit, ga pas uitbreiden als je basis goed is
 * Werk alleen: als ik bij twee personen dezelfde code zie, krijgen jullie allebei een onvoldoende
 * Gebruik comments ten overvloede! Leg uit wat je doet! Hoe de comments kort, duidelijk en volledig!
 */
            }

            Player player;

            Forest forest = new Forest();
            Swamp  swamp  = new Swamp();
            Plains plains = new Plains();

            Direwolf wolf   = new Direwolf();
            Goblin   goblin = new Goblin();
            Orc      orc    = new Orc();

            Chest   chest = new Chest();
            Diamond dia   = new Diamond();
            Key     key   = new Key();

            int    userNumber;
            string tempName;

            //creating player
            #region playerSetup
            Console.WriteLine("Greeting new player");
            Console.WriteLine("Welcome to SimpelAdventure");
            Console.ReadLine();

            Console.WriteLine("What is your name?");
            tempName = Console.ReadLine();

            Console.WriteLine("Choose a class!");
            Console.WriteLine("1. Babarian: You like hitting people with sharp stuff || 2. Sorcerer: You like hitting stuff but with lighting");
            userNumber = makeDecision(2);


            if (userNumber == 1)
            {
                player = new Barbarian(tempName);
            }
            else
            {
                player = new Sorcerer(tempName);
            }

            Console.Clear();

            Console.WriteLine("Your name is " + player.name);
            Console.WriteLine("You Choose class " + player.classname);

            Console.ReadLine();
            Console.Clear();
            #endregion

            Console.Clear();
            do
            {
                //end the game if you find both key and chest
                if (key.hasItem && chest.hasItem)
                {
                    dia.hasItem = true;
                    Console.WriteLine("You use the key on the chest and you find a diamond!");
                    Console.WriteLine("This mean you won the game for some reason");
                    Console.WriteLine("Thanks for playing the game");
                    Console.ReadLine();
                }
                else
                {
                    Console.WriteLine("Choose where you want to go");
                    Console.WriteLine("1. Church: For your healling needs 2. Forest: Lots of murder puppies\n3. Plains: Boring place nothing special 4. Swamp: What are you doing here!");
                    userNumber = makeDecision(4);

                    switch (userNumber)
                    {
                    case 1:
                        EnterChurch(player);
                        break;

                    case 2:
                        EnterLoc(forest, wolf);
                        break;

                    case 3:
                        EnterLoc(plains, goblin);
                        break;

                    case 4:
                        EnterLoc(swamp, orc);
                        break;

                    default:
                        Console.WriteLine("Something went very wrong");
                        break;
                    }
                }
            } while (!dia.hasItem);

            int makeDecision(int maxNumber)
            {
                //This is for whevenever the player has to make a decision
                string userInput;

                do
                {
                    Console.WriteLine("Choose a number between 1 and " + maxNumber);
                    userInput = Console.ReadLine();
                    int.TryParse(userInput, out userNumber);
                } while (userNumber < 1 || userNumber > maxNumber);

                Console.Clear();
                return(userNumber);
            }

            //turn based combat
            void Battle(Player p, Enemy e)
            {
                Console.WriteLine("You are fighting a " + e.name);
                Console.WriteLine("It has " + e.str);
                do
                {
                    p.health -= e.DealDamage();
                    Console.WriteLine(p.name + " has " + p.health + " hp left");
                    e.health -= p.DealDamage();
                    Console.WriteLine(e.name + " has " + e.health + " hp left");
                    Console.ReadLine();
                } while (p.health > 0 && e.health > 0);

                e.ResetHealth();

                //Earn item
                if (e.name == "Direwolf" || e.name == "Goblin")
                {
                    FindItem(key);
                }
                else if (e.name == "Orc" || e.name == "Goblin")
                {
                    FindItem(chest);
                }

                Console.ReadLine();
                Console.Clear();
            }

            //works on everytinh execpt church
            void EnterLoc(Location loc, Enemy e)
            {
                loc.welcome();

                do
                {
                    loc.options();
                    userNumber = makeDecision(2);

                    if (userNumber == 1)
                    {
                        Battle(player, e);
                    }
                    else
                    {
                        loc.Leave();
                    }
                } while (userNumber != 2);
            }

            void EnterChurch(Player p)
            {
                Church church = new Church();

                church.welcome();

                do
                {
                    church.options();
                    userNumber = makeDecision(2);

                    if (userNumber == 1)
                    {
                        Console.WriteLine("You are fully healed!");
                        church.FullHeal(p);
                    }
                    else
                    {
                        church.Leave();
                    }
                } while (userNumber != 2);
            }

            void FindItem(Item item)
            {
                Random rnd = new Random();
                int    i   = rnd.Next(2);

                if (i == 1)
                {
                    item.hasItem = true;
                    Console.WriteLine("You found " + item.itemName);
                }
                else
                {
                    Console.WriteLine("You found no loot");
                }
            }
        }
コード例 #46
0
ファイル: Forest.cs プロジェクト: marouen-lamiri/Second-Soul
	// ------- for jump into game: ----------
	public void updateMySorcerer(Sorcerer newSorcerer) {
		this.sPosition = newSorcerer;
	}
コード例 #47
0
        public static void HandleAbnormalityBegin(S_ABNORMALITY_BEGIN p)
        {
            AbnormalityManager.BeginAbnormality(p.AbnormalityId, p.TargetId, p.Duration, p.Stacks);
            if (!SettingsManager.ClassWindowSettings.Enabled)
            {
                return;
            }
            switch (SessionManager.CurrentPlayer.Class)
            {
            case Class.Mystic:
                Mystic.CheckHurricane(p);
                Mystic.CheckBuff(p);
                break;

            case Class.Warrior:
                Warrior.CheckBuff(p);
                break;

            case Class.Valkyrie:
                Valkyrie.CheckRagnarok(p);
                break;

            case Class.Archer:
                Archer.CheckFocus(p);
                Archer.CheckFocusX(p);
                Archer.CheckSniperEye(p);
                break;

            case Class.Lancer:
                Lancer.CheckArush(p);
                Lancer.CheckGshout(p);
                Lancer.CheckLineHeld(p);
                break;

            case Class.Priest:
                Priest.CheckBuff(p);
                break;

            case Class.Brawler:
                Brawler.CheckBrawlerAbnormal(p);
                break;

            case Class.Ninja:
                Ninja.CheckFocus(p);
                break;

            case Class.Sorcerer:
                Sorcerer.CheckBuff(p);
                break;

            case Class.Reaper:
                Reaper.CheckBuff(p);
                break;

            case Class.Slayer:
                Slayer.CheckBuff(p);
                break;

            case Class.Berserker:
                Berserker.CheckBuff(p);
                break;
            }
        }
コード例 #48
0
	/**
	 * 
	 * --> allows to place the sorcerer on map with params.
	 * 
	 * use null params when a client reconnects and wants to take over existing sorcerer, (will re-create it at the same position and rotation)
	 * use also when connecting for first time in the start menu scene, allows to place the sorcerer with params
	 * 
	*/
	public static void createAndSwapNewSorcerer(Sorcerer sorcererPrefab, Transform transf) {

		// important, to get the old sorcerer's (AI) position, so we can create the new one at the right position:
		// but if we do things like that (instead of getting the old sorcerer's position with an rpc call)
		// then we need to NOT removeRPCs for the old sorcerer on the server side, so we can detect it from the client.
		checkForNewSorcererNetworkInstantiatedByClient ();
		
		// copy old sorcerer so the server owns it
		// publish that copy to all
		// destroy old sorcerer

		// debug:
		Sorcerer[] sorcerers = GameObject.FindObjectsOfType<Sorcerer>(); 
		print (sorcerers.Length);
	
		Sorcerer s;

		if(sorcererPrefab != null && transf != null) {
			s = Network.Instantiate(sorcererPrefab, transf.position, transf.rotation, 0) as Sorcerer;
		}
		else if (SorcererInstanceManager.sorcerer != null) {
			// place new sorcerer where old sorcerer is before swaping/destroying it:
			// (this else if actually never runs, we need to set its position in swapSorcerers() on the server side, 
			// because we usually don't have the old sorcerer on the client side when reconnecting)
			s = Network.Instantiate(sorcererPrefab, SorcererInstanceManager.sorcerer.transform.position, SorcererInstanceManager.sorcerer.transform.rotation, 0) as Sorcerer;
		}
		else {
			// else use some defaults: new Vector3(2,0,0) at map origin:
			s = Network.Instantiate(sorcererPrefab, new Vector3(2,0,0), Quaternion.identity, 0) as Sorcerer;
		}

		// debug:
		sorcerers = GameObject.FindObjectsOfType<Sorcerer>(); 
		print (sorcerers.Length);

		swapSorcerers (s);
		
	}
コード例 #49
0
	// helper: replace old with new sorcerer:
	private static void swapSorcerers(Sorcerer newSorcerer) {

		if(SorcererInstanceManager.sorcerer != null) {

			// -------------------------
			// before destroying, place the new one at the old position and rotation:
			// (this isn't sufficient because it will only position the sorcerer correctly on the server instance
			// which is the slave game instance for the sorcerer, will be overriden as soon as player moves sorcerer on client)
			newSorcerer.transform.position = SorcererInstanceManager.sorcerer.transform.position;
			newSorcerer.transform.rotation = SorcererInstanceManager.sorcerer.transform.rotation;
			// So --> also send an RPC to send the position on the client, which is the master game instance for the sorcerer:
			ClientNetwork clientNetScript = (ClientNetwork)GameObject.FindObjectOfType(typeof(ClientNetwork));
			clientNetScript.changeSorcererPositionOnClient(SorcererInstanceManager.sorcerer.transform);

			// FIX: also make sure they appear with the right animation, 
			// e.g. usually standing up, not dead lying on the ground (which is the default right now it seems after placing a player object):
			//Animation a = SorcererInstanceManager.sorcerer.animation;
			string animationName = findFirstActiveAnimationOnGameObject(SorcererInstanceManager.sorcerer);
			clientNetScript.setSorcerersCurrentAnimationOnClient (animationName);


			// --------------------------
			// do the same for the fighter:
			if(Network.isServer) {
				Fighter fighter = (Fighter)GameObject.FindObjectOfType (typeof(Fighter));
				clientNetScript.changeFighterPositionOnClient(fighter.transform);
			}

			Network.Destroy (SorcererInstanceManager.sorcerer.networkView.viewID);

		}
		SorcererInstanceManager.sorcerer = newSorcerer;
		
		
		publishNewSorcererInstance ();
		
		
		// debug:
		Sorcerer[] sorcerers = GameObject.FindObjectsOfType<Sorcerer>(); 
		print (sorcerers.Length);

	}
コード例 #50
0
	// Use this for initialization
	void Start () {
		fighter = (Fighter)GameObject.FindObjectOfType (typeof (Fighter));
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer ();
		fighter.transform.position = initialFighterPosition;
		sorcerer.transform.position = initialSorcererPosition;
	}
コード例 #51
0
	// ======================
	/**
	 * 
	 * 
	 * 
	 */
	public static void checkForNewSorcererNetworkInstantiatedByClient() {

		Sorcerer[] sorcerers = GameObject.FindObjectsOfType<Sorcerer>(); // no, really just get the sorcerer when a client connects, end of story. // TODO optimize with FindGameObjectsWithTag instead.
		//sorcerers = GameObject.FindGameObjectsWithTag ("Sorcerer");
		if(sorcerers.Length == 2) {
			Debug.Log ("2 SORCERERS FOUND -- THE OLDER ONE SHOULD BE DELETED SOON.");
			// get the one that is not the same reference as the one we already have.
			bool indexZeroIsOldSorcerer = Object.ReferenceEquals(sorcerers[0], SorcererInstanceManager.sorcerer);
			//bool OneIsNewSorcerer = Object.ReferenceEquals(sorcerers[1], SorcererInstanceManager.sorcerer);
			if(indexZeroIsOldSorcerer) {
				//SorcererInstanceManager.createAndSwapNewSorcerer(sorcerers[1], sorcerers[1].transform);
				SorcererInstanceManager.swapSorcerers(sorcerers[1]);
			} 
			else {
				//SorcererInstanceManager.createAndSwapNewSorcerer(sorcerers[0], sorcerers[0].transform);
				SorcererInstanceManager.swapSorcerers(sorcerers[0]);
			}
		}
		else if(sorcerers.Length == 1) {
			//SorcererInstanceManager.createAndSwapNewSorcerer(sorcerers[0], sorcerers[0].transform);
			SorcererInstanceManager.sorcerer = sorcerers[0];
		}
		else if(sorcerers.Length >= 3) {
			print ("3 or more sorcerer found.");
		}
		else {
			print (" 0 sorcerer found");
		}

	}
コード例 #52
0
ファイル: ctrlSpellcasting.cs プロジェクト: lgagomes/Aemos
        private void InitializeClasses()
        {
            _currentSpellcaster = new Spellcaster();
            _selector           = new CasterSelector();
            comboBoxClasses.Items.Add("Choose a Class");

            Bard bard = new Bard()
            {
                CharacterLevel = Convert.ToInt32(comboBoxLevel.Text),
                Charisma       = Convert.ToInt32(textBoxKeyAttribute.Text)
            };

            AddSpellcasterClass(bard);
            AddKnowlerOfSpellsClass(bard);

            Cleric cleric = new Cleric()
            {
                CharacterLevel = Convert.ToInt32(comboBoxLevel.Text),
                Wisdom         = Convert.ToInt32(textBoxKeyAttribute.Text)
            };

            AddSpellcasterClass(cleric);

            Druid druid = new Druid()
            {
                CharacterLevel = Convert.ToInt32(comboBoxLevel.Text),
                Wisdom         = Convert.ToInt32(textBoxKeyAttribute.Text)
            };

            AddSpellcasterClass(druid);

            Paladin paladin = new Paladin()
            {
                CharacterLevel = Convert.ToInt32(comboBoxLevel.Text),
                Charisma       = Convert.ToInt32(textBoxKeyAttribute.Text)
            };

            AddSpellcasterClass(paladin);

            Ranger ranger = new Ranger()
            {
                CharacterLevel = Convert.ToInt32(comboBoxLevel.Text),
                Wisdom         = Convert.ToInt32(textBoxKeyAttribute.Text)
            };

            AddSpellcasterClass(ranger);

            Sorcerer sorcerer = new Sorcerer()
            {
                CharacterLevel = Convert.ToInt32(comboBoxLevel.Text),
                Charisma       = Convert.ToInt32(textBoxKeyAttribute.Text)
            };

            AddSpellcasterClass(sorcerer);
            AddKnowlerOfSpellsClass(sorcerer);

            Wizard wizard = new Wizard()
            {
                CharacterLevel = Convert.ToInt32(comboBoxLevel.Text),
                Intelligence   = Convert.ToInt32(textBoxKeyAttribute.Text)
            };

            AddSpellcasterClass(wizard);

            comboBoxClasses.SelectedIndex = 0;
        }
コード例 #53
0
 public void Init()
 {
     Sorcerer = new Sorcerer();
 }
コード例 #54
0
ファイル: Game1.cs プロジェクト: calece/Sara_RPG
        protected override void Update(GameTime gameTime)
        {
            theTime   = gameTime.TotalGameTime.Seconds;
            TotalTime = "Total Time: " + theTime.ToString() + " Difficulty: " + difficulty.ToString();
            base.Update(gameTime);
            input = Keyboard.GetState();
            if (input.IsKeyDown(Keys.Space))
            {
                Sara.Handle_Sara_Fireball(Sara, saraFireball);
            }
            Sara.HandleMovement(input, gameTime, Sara, Barriers);
            Dragon.Handle_Dragon(gameTime, dragonFireball);

            health_timer += (float)gameTime.ElapsedGameTime.TotalSeconds;

            foreach (AnimatedSprite fireball in Fireballs)
            {
                fireball.Update(gameTime);
                if (fireball.alive == true)
                {
                    fireball.alive = fireball.Check_Barriers(fireball, Barriers);
                    if (fireball.name == "Sara_Fireball")
                    {
                        foreach (Enemy enemy in Enemies)
                        {
                            fireball.HandleCollision(fireball, enemy);
                        }
                        foreach (AnimatedSprite Fireball in Fireballs)
                        {
                            if (Fireball.name != "Sara_Fireball")
                            {
                                fireball.HandleCollision(fireball, Fireball);
                            }
                        }
                    }
                }
                if (fireball.alive == false && fireball.name == "Sorc_Fireball")
                {
                    if (Sorcerer.alive)
                    {
                        fireball.alive = true;
                    }
                    fireball.position = new Vector2(Sorcerer.position.X + Sorcerer.width, 530);
                }
                else if (fireball.alive == false && fireball.name == "Dragon_Fireball")
                {
                    fireball.position = new Vector2(Dragon.position.X - (dragonFireball.width), Dragon.position.Y + 10);
                }
                if (fireball.name != "Sara_Fireball")
                {
                    fireball.position.X += fireball.speed;
                }
                else
                {
                    if (fireball.Animation == "Up" || fireball.Animation == "Down")
                    {
                        fireball.position.Y += fireball.speed;
                    }
                    else
                    {
                        fireball.position.X += fireball.speed;
                    }
                }
                if (health_timer > health_interval)
                {
                    if (Sara.HandleCollision(Sara, fireball))
                    {
                        fireball.alive = false;
                        {
                            health_bar.Update_Health(health_bar, Sara);
                            health_timer = 0;
                        }
                    }
                }
            }
            foreach (Enemy enemy in Enemies)
            {
                if (enemy.alive == true)
                {
                    enemy.Update(gameTime);
                    if (enemy.name == "Demon")
                    {
                        enemy.CheckSprint(Sara);
                    }
                    enemy.MoveEnemy();
                    if (health_timer > health_interval)
                    {
                        if (Sara.HandleCollision(Sara, enemy))
                        {
                            health_bar.Update_Health(health_bar, Sara);
                            health_timer = 0;
                        }
                    }
                }
            }



            beach.Update(gameTime);
            if (Sara.alive == false || Dragon.alive == false)
            {
                Sara.Set_Health_Damage(300, 1);
                Demon.Set_Health_Damage(10000, 150);
                Demon1.Set_Health_Damage(10000, 150);
                Demon2.Set_Health_Damage(10000, 150);
                Sorcerer.Set_Health_Damage(3, 100);
                Dragon.Set_Health_Damage(15, 300);
                health_bar.Update_Health(health_bar, Sara);
                if (Dragon.alive == false)
                {
                    foreach (Enemy enemy in Enemies)
                    {
                        enemy.speed += 0.1f;
                    }
                    Sara.speed += 0.1f;
                    difficulty += 1;
                }
                foreach (Enemy enemy in Enemies)
                {
                    enemy.alive = true;
                }

                Sara.position = new Vector2(30, 690);
                Sara.alive    = true;
            }
        }
コード例 #55
0
ファイル: NewCharCreating.cs プロジェクト: Mlarcin/DnDProject
        /**/

        /*
         *
         *
         * NAME
         *
         *      NewCharCreating::NewCharCreating- Default constrctor for NewCharCreating form
         *
         * SYNOPSIS
         *
         *     public NewCharCreating
         *
         *
         * DESCRIPTION
         *
         *      Constructor for the NewCharCreating form
         *      -Calls InitializeComponent()
         *
         * RETURNS
         *
         *      NA, constructor
         *
         * AUTHOR
         *
         *      Michael Goldberg
         *
         * DATE
         *
         *
         *
         */
        /**/

        public NewCharCreating()
        {
            InitializeComponent();
        }

        private Character playerCharacter = new Character();

        /**/

        /*
         *
         *
         * NAME
         *
         *      NewCharCreating::FirstChoiceButton_Click- Event handler for the FirstChoiceButton click event
         *
         * SYNOPSIS
         *
         *     private void FirstChoiceButton_Click(object sender, EventArgs e)
         *
         *
         * DESCRIPTION
         *
         *      Event handler for the click event for FirstChoiceButtonn
         *      -If all three character boxes are not empty
         *      --If classBox reads Barbarian
         *      ---Create a barbaian.
         *      ---Set playerCharacer to the barbarian
         *      --Else if classBox reads Bard
         *      ---Create a bard
         *      ---Set playerCharacter to the bard
         *      --Else if classBox reads Cleric
         *      ---Create a cleric
         *      ---Set playerCharacter to Cleric
         *      --Else if classBox reads Druid
         *      ---Create druid
         *      ---Set playerCharacter to Druid
         *      --Else if classBox reads Fighter
         *      ---Create a fighter
         *      ---Set playerCharacter to the fighter
         *      --Else if classBox reads Monk
         *      ---Create new monk
         *      ---Set playerCharacter to the monk
         *      --Else if classBox reads Paladin
         *      ---Create new paladin
         *      ---Set playerCharacter to the paladin
         *      --Else if classBox reads Ranger
         *      ---Create new Ranger
         *      ---Set playerCharacter to the ranger
         *      --Else if classBox reads Rogue
         *      ---Create new Rogue
         *      ---Set playercharacter to the rogue
         *      --Else if classBox reads Sorcerer
         *      ---Create new Sorcerer
         *      ---Set palyerCharacter to the sorcerer
         *      --Else if classbox reads Warlock
         *      ---Create new Warlock
         *      ---Set playerCharacter to the warlock
         *      --Else if classBox reads Wizard
         *      ---Create new Wizard
         *      ---Set playerCharacter to the Wizard
         *      -Call playerCharacter.setClass and pass in classBox's text
         *      -Call playerCharacter.setRace and pass in raceBox's text
         *      -Call playerCharacter.setName and pass in nameBox's text
         *      -Create StatAssignForm nextForm, passing in playerCharacter to it
         *      -Hide this form
         *      -Call nextForm.ShowDialog
         *      -Close this form
         *
         *
         * RETURNS
         *
         *      NA, constructor
         *
         * AUTHOR
         *
         *      Michael Goldberg
         *
         * DATE
         *
         *
         *
         */
        /**/

        private void FirstChoiceButton_Click(object sender, EventArgs e)
        {
            if (raceBox.Text != "" && classBox.Text != "" && nameBox.Text != "")
            {
                if (classBox.Text == "Barbarian")
                {
                    Barbarian newChar = new Barbarian();
                    playerCharacter = newChar;
                }
                else if (classBox.Text == "Bard")
                {
                    Bard newChar = new Bard();
                    playerCharacter = newChar;
                }
                else if (classBox.Text == "Cleric")
                {
                    Cleric newChar = new Cleric();
                    playerCharacter = newChar;
                }
                else if (classBox.Text == "Druid")
                {
                    Druid newChar = new Druid();
                    playerCharacter = newChar;
                }

                else if (classBox.Text == "Fighter")
                {
                    Fighter newChar = new Fighter();
                    playerCharacter = newChar;
                }
                else if (classBox.Text == "Monk")
                {
                    Monk newChar = new Monk();
                    playerCharacter = newChar;
                }

                else if (classBox.Text == "Paladin")
                {
                    Paladin newChar = new Paladin();
                    playerCharacter = newChar;
                }

                else if (classBox.Text == "Ranger")
                {
                    Ranger newChar = new Ranger();
                    playerCharacter = newChar;
                }
                else if (classBox.Text == "Rogue")
                {
                    Rogue newChar = new Rogue();
                    playerCharacter = newChar;
                }

                else if (classBox.Text == "Sorcerer")
                {
                    Sorcerer newChar = new Sorcerer();
                    playerCharacter = newChar;
                }
                else if (classBox.Text == "Warlock")
                {
                    Warlock newChar = new Warlock();

                    playerCharacter = newChar;
                }
                else if (classBox.Text == "Wizard")
                {
                    Wizard newChar = new Wizard();
                    playerCharacter = newChar;
                }

                playerCharacter.setClass(classBox.Text);
                playerCharacter.setName(nameBox.Text);
                playerCharacter.setRace(raceBox.Text);
                StatAssignForm nextForm = new StatAssignForm(playerCharacter);
                Hide();
                nextForm.ShowDialog();
                Close();
            }
        }
コード例 #56
0
	void Start ()
	{
		subscribeToSorcererInstancePublisher (); // jump into game

		// Getting the reference of Fighter and Sorcerer.
		fighter  = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
		sorcerer = (Sorcerer)SorcererInstanceManager.getSorcerer (); //sorcerer = (Sorcerer)GameObject.FindObjectOfType (typeof (Sorcerer));
		
		// TOOLTIPS
		// Primary and Secondary Stats tool-tip initialization.
		primaryStatsTooltip   = new Hashtable ();
		secondaryStatsTooltip = new Hashtable ();

		// Initializing the stats for Fighter and Sorcerer.
		if (fighter.playerEnabled)
		{
			// Is Fighter.
			namesPrimary = System.Enum.GetNames(typeof(primaryStatsLabelsFighter));
			primaryStatsTooltip.Add (namesPrimary [0], tooltip_Level);
			primaryStatsTooltip.Add (namesPrimary [1], tooltip_Class);
			primaryStatsTooltip.Add (namesPrimary [2], tooltip_Strength);
			primaryStatsTooltip.Add (namesPrimary [3], tooltip_Dexterity);
			primaryStatsTooltip.Add (namesPrimary [4], tooltip_Endurance);
			primaryStatsTooltip.Add (namesPrimary [5], tooltip_Health);
			primaryStatsTooltip.Add (namesPrimary [6], tooltip_Energy);
			
			primaryStatsValues = new string[namesPrimary.Length];

			namesSecondary = System.Enum.GetNames(typeof(secondaryStatsLabelsFighter));
			secondaryStatsTooltip.Add (namesSecondary [0], tooltip_Armor);
			secondaryStatsTooltip.Add (namesSecondary [1], tooltip_FireResistance);
			secondaryStatsTooltip.Add (namesSecondary [2], tooltip_ColdResistance);
			secondaryStatsTooltip.Add (namesSecondary [3], tooltip_LightningtResistance);
			secondaryStatsTooltip.Add (namesSecondary [4], tooltip_Accuracy);
			secondaryStatsTooltip.Add (namesSecondary [5], tooltip_AttackSpeed);
			secondaryStatsTooltip.Add (namesSecondary [6], tooltip_Cdr);
			secondaryStatsTooltip.Add (namesSecondary [7], tooltip_CriticalChance);
			secondaryStatsTooltip.Add (namesSecondary [8], tooltip_CriticalDamage);
			secondaryStatsTooltip.Add (namesSecondary [9], tooltip_AttackPower);
			secondaryStatsTooltip.Add (namesSecondary [10], tooltip_HealthRegen);
			secondaryStatsTooltip.Add (namesSecondary [11], tooltip_EnergyRegen);
			
			secondaryStatsValues = new string[namesSecondary.Length];
		}
		else
		{
			// Is Sorcerer.
			namesPrimary   = System.Enum.GetNames(typeof(primaryStatsLabelsSorcerer));
			primaryStatsTooltip.Add (namesPrimary [0], tooltip_Level);
			primaryStatsTooltip.Add (namesPrimary [1], tooltip_Class);
			primaryStatsTooltip.Add (namesPrimary [2], tooltip_Intelligence);
			primaryStatsTooltip.Add (namesPrimary [3], tooltip_Wisdom);
			primaryStatsTooltip.Add (namesPrimary [4], tooltip_Spirit);
			primaryStatsTooltip.Add (namesPrimary [5], tooltip_Health);
			primaryStatsTooltip.Add (namesPrimary [6], tooltip_Energy);
			
			primaryStatsValues = new string[namesPrimary.Length];

			namesSecondary = System.Enum.GetNames(typeof(secondaryStatsLabelsSorcerer));
			secondaryStatsTooltip.Add (namesSecondary [0], tooltip_Accuracy);
			secondaryStatsTooltip.Add (namesSecondary [1], tooltip_CastSpeed);
			secondaryStatsTooltip.Add (namesSecondary [2], tooltip_SpellCriticalChance);
			secondaryStatsTooltip.Add (namesSecondary [3], tooltip_SpellCriticalDamage);
			secondaryStatsTooltip.Add (namesSecondary [4], tooltip_SpellPower);
			
			secondaryStatsValues = new string[namesSecondary.Length];
		}
	}
コード例 #57
0
	// Use this for initialization
	void Start () {
		fPosition = (Fighter) GameObject.FindObjectOfType (typeof (Fighter));
		sPosition = (Sorcerer)SorcererInstanceManager.getSorcerer (); // sPosition = (Sorcerer) GameObject.FindObjectOfType (typeof (Sorcerer));
	}
コード例 #58
0
	// ------- for jump into game: ----------
	public void updateMySorcerer(Sorcerer newSorcerer) {
		this.target = newSorcerer;
	}