private void TestThatTwoHandedWeaponsCannotBeEquippedWithOffHands(EquipmentClass testCandidate) { PlayerEquipmentSlots playerEquipment = new PlayerEquipmentSlots(); EquipmentClass offHand = new OneHandedSword(); playerEquipment.EquipInOffHand(offHand); playerEquipment.EquipInMainHand(testCandidate); EquipmentClass mainHandEquipment = playerEquipment.GetMainHandEquipment(); Assert.That(mainHandEquipment, Is.Null); offHand = new OneHandedMace(); playerEquipment.EquipInOffHand(offHand); playerEquipment.EquipInMainHand(testCandidate); mainHandEquipment = playerEquipment.GetMainHandEquipment(); Assert.That(mainHandEquipment, Is.Null); offHand = new Wand(); playerEquipment.EquipInOffHand(offHand); playerEquipment.EquipInMainHand(testCandidate); mainHandEquipment = playerEquipment.GetMainHandEquipment(); Assert.That(mainHandEquipment, Is.Null); offHand = new Shield(); playerEquipment.EquipInOffHand(offHand); playerEquipment.EquipInMainHand(testCandidate); mainHandEquipment = playerEquipment.GetMainHandEquipment(); Assert.That(mainHandEquipment, Is.Null); offHand = new ForceShield(); playerEquipment.EquipInOffHand(offHand); playerEquipment.EquipInMainHand(testCandidate); mainHandEquipment = playerEquipment.GetMainHandEquipment(); Assert.That(mainHandEquipment, Is.Null); offHand = new ArrowQuiver(); playerEquipment.EquipInOffHand(offHand); playerEquipment.EquipInMainHand(testCandidate); mainHandEquipment = playerEquipment.GetMainHandEquipment(); Assert.That(mainHandEquipment, Is.Null); offHand = new BoltQuiver(); playerEquipment.EquipInOffHand(offHand); playerEquipment.EquipInMainHand(testCandidate); mainHandEquipment = playerEquipment.GetMainHandEquipment(); Assert.That(mainHandEquipment, Is.Null); }
public Wand GetById(int id) { string sqlite = @"select * from wand left join Material m1 on wand.WoodMaterialId = m1.Id left join MaterialType mt1 on m1.MaterialTypeId = mt1.Id left join Material m2 on wand.CoreMaterialId = m2.Id left join MaterialType mt2 on m2.MaterialTypeId = mt2.Id left join Wizzard on wand.Id = Wizzard.WandId where wand.id = " + id + ";"; SQLiteConnection connection = new SQLiteConnection(connectionString); Wand Wand = connection.Query <Wand, Material, MaterialType, Material, MaterialType, Wizzard, Wand> (sqlite, (wand, woodMaterial, woodMaterialType, coreMaterial, coreMaterialType, wizzard) => { wand.WoodMaterial = woodMaterial; if (wand.WoodMaterial != null) { wand.WoodMaterial.MaterialType = woodMaterialType; } wand.CoreMaterial = coreMaterial; if (wand.CoreMaterial != null) { wand.CoreMaterial.MaterialType = coreMaterialType; } wand.Wizzard = wizzard; return(wand); }, splitOn: "Id,Id,Id,Id,Id").Distinct().FirstOrDefault(); return(Wand); }
public override void Cast(Wand wand, Vector2 pos, Vector2 direction, GameObject user) { User = user; sqrR = explosionRaidius * explosionRaidius; // load projectile prefab if (prefab == null) { prefab = Resources.Load("Prefabs/Spells/MagicExplosion") as GameObject; } if (explosion == null) { explosion = Resources.Load("Prefabs/Spells/Particles/Explosion") as GameObject; } direction = direction.normalized; GameObject projectile; // spawn projectile with an offset projectile = Instantiate(prefab, pos + direction * .1f, new Quaternion()); // add volocity to the projectile projectile.GetComponent <Rigidbody2D>().velocity = direction * speed; // turn on trail //projectile.GetComponent<ParticleControler>().ParticleSystems[0].Play(); // give the projectile a refrence to this object projectile.GetComponent <ProjectileControler>().source = this; }
/** ----------------------------------------------------------------------------- Methods -----------------------------------------------------------------------------------------------------*/ void Start(){ //small Weapons wood_sword_small = GameObject.Find("Wood_Sword_Small").GetComponent<Weapon>(); wood_sword_big = GameObject.Find("Wood_Sword_Big").GetComponent<Weapon>(); sword_1_small = GameObject.Find("Sword_1_Small").GetComponent<Weapon>(); bow_small = GameObject.Find("Bow_Small").GetComponent<Weapon>(); wand_small = GameObject.Find("Wand_Small").GetComponent<Wand>(); //middle Weapons sword_1_middle = GameObject.Find("Sword_1_Middle").GetComponent<Weapon>(); sword_2_small = GameObject.Find("Sword_2_Small").GetComponent<Weapon>(); mace_1 = GameObject.Find("Mace_1").GetComponent<Weapon>(); axe = GameObject.Find("Axe").GetComponent<Weapon>(); wand_middle = GameObject.Find("Wand_Middle").GetComponent<Wand>(); //big Weapons sword_1_big = GameObject.Find("Sword_1_Big").GetComponent<Weapon>(); sword_2_big = GameObject.Find("Sword_2_Big").GetComponent<Weapon>(); mace_2 = GameObject.Find("Mace_2").GetComponent<Weapon>(); axe_big = GameObject.Find("Axe_Big").GetComponent<Weapon>(); bow_big = GameObject.Find("Bow_Big").GetComponent<Weapon>(); wand_big = GameObject.Find("Wand_Big").GetComponent<Wand>(); //Shields shield_small = GameObject.Find("Shield_Small").GetComponent<Shield>(); shield_big = GameObject.Find("Shield_Big").GetComponent<Shield>(); //init Lists and Dictionaries initListsAndDictionaries(); }
public static void Reset() { Spawned = false; Wand1 = null; Wand2 = null; }
public static void Complete() { Wand1 = null; Wand2 = null; Journal.Remove(Journal.Feature.WANDMAKER); }
public void TestInitialize() { itemToBeAdded = new List <GameObject>(); itemToBeDeleted = new List <GameObject>(); allObject = new List <GameObject>(); testPlayer = new Player.Player(200, 200); testMediator = new Mediator(allObject, itemToBeAdded, itemToBeDeleted, testPlayer, testRoom, TestState); testRoom = new Room(800, 400, testMediator); testMediator.room = testRoom; testWall = new Wall(200, 200, testMediator); testMonster = new Creep.Creep(200, 200, testMediator); testMonster2 = new Creep.Creep(200, 200, testMediator); HpPlus = 100; testHpBoost = new HpBoost(HpPlus, 200, 200, testMediator); testMSBoost = new MsBoost(200, 200, testMediator); ExpectedMs = testMSBoost.SpeedBoost; testCrossbow = new Crossbow(200, 200, testMediator); testBow = new FrozenBow(200, 200, testMediator); testGun = new SimpleGun(200, 200, testMediator); testWand = new Wand(200, 200, testMediator); testLaveTile = new LavaTile(200, 200, 5, testMediator); testDoor = new Door(200, 200, testMediator, true); FBProjectile = new FrozenBowProjectile(200, 200, Direction.NORTH, testMediator); WProjectile = new WandProjectile(200, 200, Direction.NORTH, testMediator); SGProjectile = new SimpleGunProjectile(200, 200, Direction.NORTH, testMediator); CBProjectile = new CrossbowProjectile(200, 200, Direction.NORTH, testMediator); }
void Start() { //Get the wand component attached to this GameObject wand = GetComponent <CC_WAND>().wand; wandName = gameObject.name; }
public void IsMagickWandInstantiatedTest() { Wand.OpenEnvironment(); Assert.IsTrue(Wand.IsWandInstantiated); Wand.CloseEnvironment(); Assert.IsFalse(Wand.IsWandInstantiated); }
public void TestThatOffhandWandsCanOnlyBeEquippedWithOneHandedWeapons() { EquipmentClass offHand = new Wand(); EquipmentClass secondOffHandInstance = new Wand(); TestThatOffHanderCanOnlyBeEquippedWithOneHander(offHand, secondOffHandInstance); }
public void TestThatWandsCanBeEquippedWithShieldsAndForceShields() { EquipmentClass firstTestCandidate = new Wand(); EquipmentClass secondTestCandidate = new Wand(); TestThatOneHandedWeaponCanBeEquippedWithShieldAndForceShield(firstTestCandidate, secondTestCandidate); }
void Update() { // Set controller style from input profile if (App.VrSdk.VrControls == null) { App.VrSdk.SetControllerStyle(ProfileLoader.Instance.GetControllerStyle()); } // Update controller infos. for (int i = 0; i < m_ControllerInfos.Length; ++i) { m_ControllerInfos[i].Update(); } //cache touch inputs so we can control their usage m_Touch.m_Valid = (Input.touchCount > 0) && (Input.GetTouch(0).phase == TouchPhase.Began); if (m_Touch.m_Valid) { m_Touch.m_Pos = Input.GetTouch(0).position; } // Update touch locators. // Controller pad touch locator should be active if thumb is on the pad. // For the brush controller, tools can override this, unless we're in the intro tutorial. Brush.Behavior.SetTouchLocatorActive(Brush.GetPadTouch() && (SketchSurfacePanel.m_Instance.ActiveTool.ShouldShowTouch() || TutorialManager.m_Instance.TutorialActive())); Wand.Behavior.SetTouchLocatorActive(Wand.GetPadTouch()); Wand.Behavior.SetTouchLocatorPosition(Wand.GetPadValue()); Brush.Behavior.SetTouchLocatorPosition(Brush.GetPadValue()); }
// Update is called once per frame void Update() { wandscript = wand.GetComponent <Wand>(); if (lgrab.GetGrabbedObject() != null) { weapon = lgrab.GetGrabbedObject(); controllerevents = RController.GetComponent <VRTK_ControllerEvents>(); wandscript.controller = LController.GetComponent <VRTK_ControllerEvents>(); swordscript.controllerEvents = LController.GetComponent <VRTK_ControllerEvents>(); } else { weapon = rgrab.GetGrabbedObject(); controllerevents = RController.GetComponent <VRTK_ControllerEvents>(); wandscript.controller = RController.GetComponent <VRTK_ControllerEvents>(); swordscript.controllerEvents = RController.GetComponent <VRTK_ControllerEvents>(); } if (controllerevents == null) { VRTK_Logger.Error(VRTK_Logger.GetCommonMessage(VRTK_Logger.CommonMessageKeys.REQUIRED_COMPONENT_MISSING_FROM_GAMEOBJECT, "VRTK_ControllerEvents_ListenerExample", "VRTK_ControllerEvents", "the same")); return; } controllerevents.ButtonTwoPressed += DoButtonTwoPressed; controllerevents.ButtonTwoReleased += DoButtonTwoReleased; }
public void AddWand(GameObject wand) { if (wands.Count != 0) { audioSource.PlayOneShot(newWandAudio); } Wand wandScript = wand.GetComponent <Wand>(); for (int i = 0; i < wands.Count; i++) //checks if the wand is a duplicate { if (wands[i].Equals(wandScript)) { wands[i].LevelUp(); Destroy(wand); return; } } wand.transform.parent = wandContainer; wand.transform.localPosition = Vector3.zero; wand.transform.localScale = Vector3.one; wand.transform.localRotation = Quaternion.identity; wands.Add(wand.GetComponent <Wand>()); wand.SetActive(false); }
public void TestThatWandsCannotBeEquippedWithQuivers() { EquipmentClass firstTestCandidate = new Wand(); EquipmentClass secondTestCandidate = new Wand(); TestThatOneHandedWeaponCannotBeEquippedWithQuivers(firstTestCandidate, secondTestCandidate); }
public void LoadTest() { string val = WandNativeString.Load(Wand.GetHandle(), false); Debug.WriteLine(val); Assert.IsNotNull(val); }
public void SetPlaceOwner(int x, int y, Wand newOwner) { if (ValidXY(x, y)) { placeGrid[x, y].SetOwner(newOwner); UpdateGO(x, y); } }
public bool GetCommand(SketchCommands rCommand) { // Here you can limit the given command to a specific scope, e.g. only allowing it on the Wand // or Brush, but the the controller info is responsible for how that command is mapped to the // hardware. KeyboardShortcut?shortcut = MapCommandToKeyboard(rCommand); bool isDemoMode = DemoManager.m_Instance.DemoModeEnabled; switch (rCommand) { case SketchCommands.Activate: return(Brush.GetCommand(rCommand) || (!isDemoMode && GetMouseButton(0))); case SketchCommands.AltActivate: return(GetMouseButton(1) || Wand.GetCommand(rCommand)); case SketchCommands.LockToHead: return(GetKeyboardShortcut(shortcut.Value)); case SketchCommands.PivotRotation: return(GetKeyboardShortcut(shortcut.Value)); case SketchCommands.WandRotation: return(Wand.GetCommand(rCommand)); case SketchCommands.LockToController: return(Wand.GetCommand(rCommand) || Brush.GetCommand(rCommand)); case SketchCommands.Scale: return(GetKeyboardShortcut(shortcut.Value) || Brush.GetCommand(rCommand)); case SketchCommands.Sensitivity: return(Mathf.Abs(Input.GetAxis("Mouse ScrollWheel")) > m_InputThreshold); case SketchCommands.Panic: return(GetMouseButton(1) || Wand.GetCommand(rCommand)); case SketchCommands.MultiCamSelection: return(Brush.GetCommand(rCommand)); case SketchCommands.ShowPinCushion: return(Brush.GetCommand(rCommand)); case SketchCommands.DuplicateSelection: return(Brush.GetCommand(rCommand)); case SketchCommands.Undo: case SketchCommands.Redo: return(Wand.GetCommand(rCommand)); case SketchCommands.Fly: return(Brush.GetCommand(rCommand)); } return(false); }
public Wand(Wand wand) { type = wand.type; position = wand.position; rotation = wand.rotation; stick = new Vector2(wand.stick.x, wand.stick.y); triggerProcess = wand.triggerProcess; keyStatus = wand.keyStatus; }
public void WandsRepresentASpecificSpell() { var spell = new Spell("Cure Light Wounds", "healing"); var wand = new Wand(spell, 50, 750); Assert.Equal(wand.Name, "Wand of Cure Light Wounds"); Assert.Equal(wand.Charges, 50); Assert.Equal(wand.Value, 750); }
public void Purge() { attackAbility = null; defenseAbility = null; utilityAbility = null; passiveAbility = null; activeWand = null; }
// Use this for initialization void Start() { string[] spellArray = { "Teleport", "Firebolt", "Paralyzer", "Shield" }; Wand playerWand = new Wand(pointer, reticle, spellArray); player = new Player(playerWand); teleporting = false; needWand = true; }
public float GetWandScrollAmount() { // Check controller scroll direction. if (App.VrSdk.VrControls.PrimaryScrollDirectionIsX(ControllerName.Wand)) { return(Wand.GetScrollXDelta()); } return(Wand.GetScrollYDelta()); }
private static void RemoveSlnRefs() { var slns = Wand.GetSolutionFiles(@"C:\source\Mercury\src"); foreach (var sln in slns) { sln.RemoveProjectReference(LogRepoServiceContracts); sln.RemoveProjectReference(LoggingClient); } }
private Wand CreateWand(string color, string desc, string name, Wand.eMaterialType type) { var wand = new Wand(); wand.Color = color; wand.Description = desc; wand.Name = name; wand.MaterialType = type; return(wand); }
public void EquipWand(Wand wandToEquip) { if (equippedWand != null) { Destroy(equippedWand.gameObject); } equippedWand = Instantiate(wandToEquip, weaponHold.position, weaponHold.rotation) as Wand; equippedWand.transform.parent = weaponHold; equippedWand.mana = 5; }
public void EquipWand(Wand wandToEquip) { if (equippedWand != null) { Destroy (equippedWand.gameObject); } equippedWand = Instantiate (wandToEquip, weaponHold.position, weaponHold.rotation) as Wand; equippedWand.transform.parent = weaponHold; equippedWand.mana = 5; }
private static void RemoveProjectRefs() { var projs = Wand.GetCsProjFiles(@"C:\source\Mercury\src"); foreach (var proj in projs) { proj.RemoveProjectReference(LogRepoServiceContracts); proj.RemoveProjectReference(LoggingClient); } }
public bool GetCommandDown(SketchCommands rCommand) { // Here you can limit the given command to a specific scope, e.g. only allowing it on the Wand // or Brush, but the the controller info is responsible for how that command is mapped to the // hardware. KeyboardShortcut?shortcut = MapCommandToKeyboard(rCommand); switch (rCommand) { case SketchCommands.Activate: return(GetMouseButtonDown(0) || Brush.GetCommandDown(rCommand)); case SketchCommands.RewindTimeline: case SketchCommands.AdvanceTimeline: case SketchCommands.TimelineHome: case SketchCommands.TimelineEnd: case SketchCommands.Reset: case SketchCommands.Undo: case SketchCommands.Redo: return(GetKeyboardShortcutDown(shortcut.Value) || Wand.GetCommandDown(rCommand)); case SketchCommands.DuplicateSelection: return((SketchControlsScript.m_Instance.OneHandGrabController != ControllerName.None && Controllers[(int)SketchControlsScript.m_Instance.OneHandGrabController] .GetCommandDown(rCommand)) || Brush.GetCommandDown(rCommand)); // Keyboard only: case SketchCommands.Delete: case SketchCommands.Abort: return(GetKeyboardShortcutDown(shortcut.Value)); // Brush only case SketchCommands.Teleport: case SketchCommands.ToggleDefaultTool: case SketchCommands.MenuContextClick: case SketchCommands.ToggleSelection: return(Brush.GetCommandDown(rCommand)); // Misc case SketchCommands.SwapControls: return(HasSwapGestureCompleted()); case SketchCommands.AltActivate: return(GetMouseButtonDown(1) || Wand.GetCommandDown(rCommand)); #if (UNITY_EDITOR || EXPERIMENTAL_ENABLED) case SketchCommands.ShowPinCushion: return(Brush.GetCommandDown(rCommand)); #endif } return(false); }
public void EquipWand(Wand wand) { activeWand = wand; attackAbility = activeWand.attackAbility; defenseAbility = activeWand.defenseAbility; utilityAbility = activeWand.utilityAbility; passiveAbility = activeWand.passiveAbility; passiveAbility.EngageState(true); }
// Update is called once per frame void Update() { if (gameManager.GameStarted) { Wand wand = FindObjectOfType <Wand>(); if (castMagic.GetStateDown(SteamVR_Input_Sources.RightHand)) { GameObject go = new GameObject(); currLine = go.AddComponent <LineRenderer>(); currLine.startWidth = 0.05f; currLine.endWidth = 0.05f; currLine.material = lineMat; currLine.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off; audioSource.clip = pressClip; audioSource.Play(); //talk to logan's wand wand.StartCasting(); numClicks = 0; } else if (castMagic.GetLastStateUp(SteamVR_Input_Sources.Any)) { wand.StopCasting(); //audioSource.clip = releaseClip; //audioSource.Play(); } else if (castMagic.GetState(SteamVR_Input_Sources.RightHand)) { GameObject magic = Instantiate(particleMagic, spawnPoint.transform.position, Quaternion.identity); magic.transform.localScale = new Vector3(0.1f, 0.1f, 0.1f); if (currLine == null) { return; } currLine.positionCount = numClicks + 1; currLine.SetPosition(numClicks, spawnPoint.transform.position); numClicks++; } } else { if (castMagic.GetStateDown(SteamVR_Input_Sources.Any)) { audioSource.clip = magicBlast; audioSource.Play(); GameObject magic = Instantiate(particleBlast, spawnPoint.transform.position, Quaternion.identity); magic.transform.localScale = new Vector3(0.05f, 0.05f, 0.05f); magic.GetComponent <Rigidbody>().AddForce(transform.up * 350); } } }
public float GetToolSelection() { float fScrollWheel = Input.GetAxis("Mouse ScrollWheel"); if (Mathf.Abs(fScrollWheel) > m_InputThreshold) { return(fScrollWheel); } return(Wand.GetScrollYDelta()); }
// Use this for initialization void Start () { wand = GameObject.FindObjectOfType<Wand> (); // make instrument 5 crescendo at time 10 KeyTimes [0] = 3.0f; KeyActions [0] = Wand.Action.CRESCENDO; PayLoad [0] = (int) Instrument.bass; // make instrument 3 decrescendo at time 15 KeyTimes [1] = 15.0f; KeyActions [1] = Wand.Action.DECRESCENDO; PayLoad [1] = (int) Instrument.viola; // do a tempo change at time 30 KeyTimes [2] = 30f; KeyActions [2] = Wand.Action.TEMPOCHANGE; PayLoad [2] = 100; }
public void RegisterWand(Wand wand) { _Wand = wand; }
Wand.Gesture mostCommonGesture(Wand.Gesture[] gestures) { int[] count = new int[5]; foreach (Wand.Gesture g in gestures) { if (g != Gesture.NONE) { count[(int) g]++; } } int maxIndex = 0; int maxCount = 0; for (int i = 0; i < count.Length; i++) { if (count[i] > maxCount) { maxCount = count[i]; maxIndex = i; } } //Debug.Log ("most common: " + (Wand.Gesture) maxIndex); return (Wand.Gesture)maxIndex; }
public void Awake() { Transform tr = transform.Find("Background"); if(!tr) { Debug.LogError("Error in " + name + " menu : no background gameobject child attached with name \"Background\""); Destroy(gameObject); } background = tr.gameObject; ScaleBackground(); wand = GameObject.FindObjectOfType(typeof(Wand)) as Wand; widgets = new List<Widget>(); Widget[] awidgets = GetComponentsInChildren<Widget>(); for(int i=0;i<awidgets.Length;i++) { if(awidgets[i] is SubmitButton) { Submit = (SubmitButton)awidgets[i]; ((SubmitButton)awidgets[i]).OnSubmit += OnSubmit; //Subscribe the OnSubmit method to SubmitButton's OnSubmit event. } //Add non-label widgets else if(!(awidgets[i] is LabelWidget)) { widgets.Add (awidgets[i]); awidgets[i].OnWidgetClick += OnWidgetClick; awidgets[i].OnWidgetHover += OnWidgetHover; awidgets[i].OnWidgetLeave += OnWidgetLeave; } //Add label widgets else if(awidgets[i] is LabelWidget) { labels.Add(awidgets[i] as LabelWidget); } } SortWidgets(); }