void Start() { player = GameObject.FindGameObjectWithTag("Player"); playerStats = player.GetComponent <PlayerStats>(); fbc = GetComponentInParent <FireballController>(); fireball = GameObject.FindGameObjectWithTag("Player").GetComponentInChildren <Fireball>(); }
// Update is called once per frame void Update() { TowerUpdate(); if (Game.TargetEnemy != null) { if (inRange(Game.TargetEnemy)) { target = Game.TargetEnemy; return; } } if (target == null) { GetTarget(ref target); } else { Debug.Log(speedBoost); if (time <= 0) { Fireball fb = GameObject.Instantiate(fireball).GetComponent <Fireball>(); fb.transform.position = transform.position; fb.Init(target, 1 + chargeLevel); time += speed; } else { time -= Time.deltaTime * Game.GameSpeed * speedBoost; } } speedBoost = 1; }
public void CheckWizardCollisions(Wizard wizard, GameTime gameTime) { fireballs.ForEach(f => { if (f == null) { return; } var radiusAdded = f.radius + wizard.radius; if (Vector2.Distance(f.GetPosition(), wizard.GetPosition()) < radiusAdded - 30f) { wizard.ApplyHealth(-f.damage); fireballRemovals.Add(f); Fireball newFireball = spawner.Spawn(game); newFireball.LoadContent(); fireballAdditions.Add(newFireball); BuildFireballSplash(gameTime, f.GetPosition()); PlaySplashSoundEffect(); } }); fireballs.RemoveAll(f => fireballRemovals.Contains(f)); fireballs.AddRange(fireballAdditions); ClearLists(); }
private void init() { // init xml //XmlDocument xml = new XmlDocument(); //xml.Load(Application.dataPath + "/xml/Skills.xml"); // Put all skills into skillList in order Fireball fireball = new Fireball(); skillList.Add(fireball); //initSigleSkillWithXML(fireball, xml.GetElementById("skill_fireball")); // Loop and create cell int size = skillList.Count; for (int i = 0; i < size; i++) { GameObject cell = Instantiate(cellPrefab, panel.transform); cell.name = "cell" + i.ToString(); int idx = i; ((Button)(cell.transform.Find("Icon").gameObject.GetComponent <Button>())).onClick.AddListener(() => setSelectedSkill(idx)); ((Image)(cell.transform.Find("Icon").gameObject.GetComponent <Image>())).sprite = Resources.Load <Sprite>(Global.PREFAB_IMAGE_SKILL_PATH + ((Skill)skillList[i]).skillId); cell.transform.Find("Locked").gameObject.SetActive(((Skill)skillList[i]).isLocked); } }
void Update() { if (Input.GetMouseButtonDown(0)) { // Определяем точку центра экрана Vector3 point = new Vector3(_camera.pixelWidth / 2, _camera.scaledPixelHeight / 2, 0); // Создаем луч Ray ray = _camera.ScreenPointToRay(point); RaycastHit hit; if (Physics.Raycast(ray, out hit)) { // Определяем объект попадания луча GameObject hitObject = hit.transform.gameObject; ReactiveTarget target = hitObject.GetComponent <ReactiveTarget> (); Fireball fireball = hitObject.GetComponent <Fireball> (); // Проверяем попадание в цель if (target != null) { target.ReactToHit(); //Debug.Log ("Target hit"); } else if (fireball == null) { StartCoroutine(SphereIndicator(hit.point)); //Debug.Log ("Hit " + hit.point); } } } }
public void Invoke(EAbilities ability, Vector2 _direction, Vector2 _pos, int _targetLayer) { AbilityBase newAbility = null; if (cooldown.IsStopped()) { switch (ability) { case EAbilities.FIREBALL: newAbility = new Fireball(_direction, _pos, _targetLayer); break; case EAbilities.PYROBLAST: newAbility = new Pyroblast(_direction, _pos, _targetLayer); break; case EAbilities.CHAIN_LIGHTNING: newAbility = new ChainLightning(_direction, _pos, _targetLayer); break; default: newAbility = new Fireball(_direction, _pos, _targetLayer); break; } cooldown.WaitTime = newAbility.cooldown; cooldown.Start(); AddChild(newAbility); } }
public void CreateFireball(Fireball fireball) { if (IsHost) { NetFireballBehavior b = new NetFireballBehavior(fireball); fireball.Behaviors.Add(b); _writer.Write("CreateFireball"); _writer.Write(b.Id); } else { _writer.Write("RequestFireball"); } _writer.Write(fireball.Position); _writer.Write((int)fireball.Direction); _writer.Write(fireball.Color); if ((DateTime.Now - _lastRequest).Seconds > 2.0f) { _session.LocalGamers[0].SendData(_writer, SendDataOptions.ReliableInOrder); _lastRequest = DateTime.Now; } if (IsHost) { GameMain.CurrentLevel.AddEntity(fireball); } }
private void Update() { if (_unitsInAttackRange.Count > 0 && _timeFromLastAttack >= _delayBetweenAttacks) { for (int i = 0; i < _unitsInAttackRange.Count; i++) { if (_unitsInAttackRange[i] == null) { _unitsInAttackRange.RemoveAt(i); i--; } else { if (_unitsInAttackRange[i].IsAlive == true) { _unitsInAttackRange[i].ApplyDamage(_enemy); _timeFromLastAttack = 0; Fireball fireball = Instantiate(_fireball, _shootPoint.position, Quaternion.identity); fireball.ApplyTarget(_unitsInAttackRange[i]); } return; } } } _timeFromLastAttack += Time.deltaTime; }
public void InitializeFB() { Vector3 playerPos = player.gameObject.transform.position; Vector3 fbPos = new Vector3(playerPos.x, playerPos.y + 0.25f, 0); initialFireball = Instantiate(prefabFb, fbPos, Quaternion.identity); }
public static void RunTests() { Console.WriteLine("Base Ability: "); Ability normal = new Ability(); normal.Activate(); Console.WriteLine("\n\nDerived Ability: "); Ability openChest = new Open("Open Chest."); openChest.Activate(); Console.WriteLine("\n\nInterface Spell: "); Fireball fireball = new Fireball(3.5f, (d) => { Console.WriteLine("Burn..."); }); Console.WriteLine("-----------"); fireball.Cast(); Console.WriteLine("\n\nUsing both Interface & Inheritance: "); SuperAbility myUlt = new SuperAbility("Lord of Vermillion", (cool) => { Console.WriteLine("Lightning crashes down from the heavens, the caster needs to rest for " + cool + "seconds"); }); myUlt.SetCooldown(6); myUlt.Cast(); Console.WriteLine("\n\nEnd of Inheritance/Interface Examples"); }
private void Shoot() { Vector3 prefabPos = transform.position; Quaternion prefabRot = transform.rotation; Vector3 movementVector = new Vector3(0, 0, 0); if (lookDirection == Look.LEFT) { prefabPos.x -= 1; prefabRot = Quaternion.Euler(0, 0, 180); movementVector.x = -1; } else if (lookDirection == Look.RIGHT) { prefabPos.x += 1; movementVector.x = 1; } else if (lookDirection == Look.UP) { prefabPos.y += 1; prefabRot = Quaternion.Euler(0, 0, 90); movementVector.y = 1; } else if (lookDirection == Look.DOWN) { prefabPos.y -= 1; prefabRot = Quaternion.Euler(0, 0, -90); movementVector.y = -1; } Fireball fireball = Instantiate(fireballPrefab, transform.position + (0.5f * movementVector), prefabRot).GetComponent <Fireball>(); fireball.movementTargetVector = movementVector; fireball.movementTargetPoint = prefabPos; }
public void CastProjectile() { Debug.Log("cast project"); Fireball fireballInstance = (Fireball)Instantiate(fireball, ProjectileSpawn.position, ProjectileSpawn.rotation); fireballInstance.Direction = ProjectileSpawn.forward; }
public override void StartEffect(Effect effect) { rb = effect.Instance.GetComponent <Rigidbody>(); //Get the riggidbody of the effect hasLookAt = effect.Owner.GetComponent <LookAt>(); //Check if the owner has lookAt Fireball fireball = effect.Instance.GetComponent <Fireball>(); if (fireball) { fireball.Owner = effect.Owner.gameObject; } if (hasLookAt && hasLookAt.active && hasLookAt.IsAiming) { rb.AddForce(hasLookAt.Direction.normalized * velocity); } else { Animator ownerAnimator = effect.Owner.GetComponent <Animator>(); Vector3 velocityv = ownerAnimator.velocity.normalized; if (ownerAnimator.velocity.magnitude < 0.1) { velocityv = effect.Owner.transform.forward; } rb.AddForce(velocityv * velocity); } }
private IEnumerator FireballAttack() { canAttack = false; //Play attack sound AudioSource.PlayClipAtPoint(attackSound, Camera.main.transform.position, 0.1f); //Get player direction int direction = isoRenderer.GetLastDirection(); //Create fireball Fireball fireball = Instantiate(fireballPrefab).GetComponent<Fireball>(); fireball.Setup(direction, transform.position); //Delay yield return new WaitForSeconds(0.1f); canAttack = true; ; //Delay yield return new WaitForSeconds(3f); //Destroy fireball if (fireball != null) { Destroy(fireball.gameObject); } }
private void DropPrincess() { m_Scream.Play(); m_FireBallTimer = 2f; Princess princess = GameManager.m_Instance.GetObjectPool.GetPrincess(); Vector2 dropPosHigh = new Vector2(Random.Range(-2f, 2f), transform.position.y); Vector2 dropPos = new Vector2(dropPosHigh.x, dropPosHigh.y - 5f); GameManager.m_Instance.PrincessFalling(dropPosHigh); princess.Activate(dropPosHigh, GameManager.m_Instance.GetBulletDirection(dropPosHigh, dropPos)); for (int i = 0; i < 12; i++) { Fireball fireBall = GameManager.m_Instance.GetObjectPool.GetFireBall(); if (i < 6) { Vector2 startpos = dropPosHigh; startpos.x -= 1.5f; Vector2 pos = new Vector2(startpos.x - (1.2f * i), princess.transform.position.y); fireBall.Activate(pos, GameManager.m_Instance.GetBulletDirection(pos, new Vector2(pos.x, pos.y - 1))); } else { Vector2 startpos = dropPosHigh; startpos.x -= 5.5f; Vector2 pos = new Vector2(startpos.x + (1.2f * i), princess.transform.position.y); fireBall.Activate(pos, GameManager.m_Instance.GetBulletDirection(pos, new Vector2(pos.x, pos.y - 1))); } } }
private void ShootFireball() { Fireball fireball = new Fireball(Position + new Vector2(0, 1), FacingRight); this.world.AddEntity(fireball); Sounds.SoundLoader.Fireball(Position); }
public void CastProjectile() { Fireball fireballInstance = Instantiate(fireball, ProjectileSpawn.position, ProjectileSpawn.rotation); Fireball.SetStats(Stats); fireballInstance.Direction = ProjectileSpawn.forward; }
public void UpdateAbilityData(int slot) { int id = abilities[slot].GetID(); switch (id) { case 1: Frenzy frenzy = (Frenzy)abilities[slot]; frenzy.CalculateMult(); break; case 2: Rage rage = (Rage)abilities[slot]; rage.CalculateMult(); break; case 3: Mine mine = (Mine)abilities[slot]; mine.CalculateDamage(); break; case 4: Fireball fireball = (Fireball)abilities[slot]; fireball.CalculateDamage(); break; } }
// Update is called once per frame void Update() { float inputX = Input.GetAxis("Mouse X"); float inputY = Input.GetAxis("Mouse Y"); if (Input.GetMouseButtonDown(0) /*&& !EventSystem.current.IsPointerOverGameObject()*/) { Vector2 point = new Vector2(inputX, inputY); Fireball ball = GetComponent <Fireball>(); transform.Translate(inputX, inputY, 0); StartCoroutine(Shoot()); if (target != null) { target.ReactToHit(); soundSource.PlayOneShot(hitEnemySound); } else { soundSource.PlayOneShot(hitWallSound); } } }
public ExplosiveFlask(int rarity) { _rarity = rarity; if (_rarity == 1) { Name = "Low Quality Explosive Flask"; Value = 30; fireball = new Fireball(5, 80, 4, 0, 0, 0, 0, 0, "Explosive"); } else if (_rarity == 2) { Name = "Explosive Flask"; Value = 50; fireball = new Fireball(9, 85, 4, 0, 0, 0, 0, 0, "Explosive"); } else { Name = "High Quality Explosive Flask"; Value = 100; fireball = new Fireball(13, 95, 4, 0, 0, 0, 0, 0, "Explosive"); } Color = RLColor.LightGreen; RemainingUses = 3; }
public TheFireArcanian(Vector2 position, PlayerIndex thePlayerIndex) : base(position, thePlayerIndex) { // Initialize texture texArcanianRight = "Arcanian/flameFoxRight"; texArcanianLeft = "Arcanian/flameFoxLeft"; texDyingRight = "Arcanian/flameFoxDead_right"; texDyingLeft = "Arcanian/flameFoxDead_left"; texShield = "Arcanian/fireshieldsprite"; Texture = texArcanianRight; // Initialize name mName = "Fire Arcanian"; // Initialize shield mShieldArt.SetTextureSpriteSheet(texShield, 4, 1, 0); mShieldArt.UseSpriteSheet = true; // Initliaze fire skills Fireball fireball = new Fireball(); MultipleFireBall multipleFireBall = new MultipleFireBall(); MegaFireBall megaFireBall = new MegaFireBall(); // Initialize skill set with fire skills mSkillSet = new SkillSet(fireball, multipleFireBall, megaFireBall, null); // Add skills to global list of skills //G.ListOfSkills.Add(fireball); //G.ListOfSkills.Add(multipleFireBall); //G.ListOfSkills.Add(megaFireBall); }
// Update is called once per frame void Update() { arrow = GameObject.FindGameObjectWithTag("PlayerArrow"); fireball = GameObject.FindGameObjectWithTag("PlayerFireball"); if (arrow != null) { fireballscript = arrow.GetComponent <Fireball>(); if (Vector3.Distance(gameObject.transform.position, arrow.transform.position) <= 1.5f) { TakeDamage(fireballscript.damage); Debug.Log("BOSS HP IS: " + health); Destroy(arrow); } } if (fireball != null) { fireballscript = fireball.GetComponent <Fireball>(); // Debug.Log("DISTANCE BETWEEN FIREBALL AND BOSS IS: " + Vector3.Distance(gameObject.transform.position, fireball.transform.position)); if (Vector3.Distance(gameObject.transform.position, fireball.transform.position) <= 1f) { TakeDamage(fireballscript.damage); Debug.Log("BOSS HP IS: " + health); Destroy(fireball); Destroy(Instantiate(contactexplode, transform.position, Quaternion.identity), 2.0f); } } }
void Awake() { Client.GameStarted += StartGame; CurrentMenu = StartScreen.Instance(); CurrentContextMenu = EmptyContextMenu.Instance(); State = GameState.START_SCREEN; MaximumPlayers = StartPoints.Count; FieldWidth = fieldwidth; FieldHeight = fieldheight; GroundWidth = groundwidth; GroundHeight = groundheight; Players = players; Field.Width = FieldWidth; Field.Height = FieldHeight; Ground.Width = GroundWidth; Ground.Height = GroundHeight; StartPoints.Add(new Point(0 - (Ground.Width / 2), 0 - (Ground.Height / 2))); StartPoints.Add(new Point(0 - (Ground.Width / 2), (Ground.Height / 2) - 1)); StartPoints.Add(new Point(Ground.Width / 2, Ground.Height / 2)); StartPoints.Add(new Point(Ground.Width / 2, 0 - ((Ground.Height / 2) - 1))); Rectangles.Add(new Rect(0 - Ground.Width / 2, 0 - Ground.Height / 2, Ground.Width, Ground.Height)); Rectangles.Add(new Rect(0 - Field.Width / 2, 0 - Field.Height / 2, Field.Width, Field.Height)); SpellList.Add(Fireball.Instance()); SpellList.Add(Blink.Instance()); }
private void BuildFireballSplash(GameTime gameTime, Vector2 pos) { var particleEngine = new ParticleEngine(game, particleTextures, pos, Fireball.BuildPalette(), 50); particleEngine.Update(gameTime); particleEngines.Add(particleEngine); }
private void castMagic() { // Change character expression. AnimationEvents animScript = GetComponentInChildren <AnimationEvents>(); animScript.SetExpression("MagicLaunchFace"); // Substract MP from UI magicControlUIScript.consumeMp(magicControlUIScript.fireballCost); freezeDueCasting = 0.5f; // We instantiate a magic fireball! GameObject fireballPrefab = availableMagics[0]; GameObject go = (GameObject)Instantiate(fireballPrefab); Fireball fireballScript = go.GetComponent <Fireball>(); fireballScript.target = targetPos; fireballScript.speed = 10f; fireballScript.startPosition = lastStaffPoint; // Call character control onCastingFinished for a pushback. GetComponentInParent <CharacterControl>().castingPushback(targetPos); GetComponentInParent <CharacterControl>().onCastingFinished(); // Assign cooldown to prevent new magic. magicCooldown = 1f; }
public override void SecondaryAbility() { GameObject fball = Instantiate("DaenerysFireball"); fball.transform.SetPosition(GetSecondaryPosition(curr_position)); fball.transform.SetRotation(player.transform.GetRotation()); Fireball fballscript = fball.GetComponent <Fireball>(); fballscript.vfront = curr_forward; fballscript.fireball_particles = daenerys_fireball_particles; fballscript.fireball_particles2 = daenerys_fireball_particles2; fballscript.fireball_particles3 = daenerys_fireball_particles3; fballscript.fireball_particles4 = daenerys_fireball_particles4; fballscript.SetDamage(sec_ability_dmg); GameObject coll_object = PhysX.RayCast(curr_position, curr_forward, 254.0f); if (coll_object != null) { coll_object.GetTag(); if (coll_object.CompareTag("Enemy")) { fballscript.vfront = GetSecondaryForwardToEnemy(fball.transform.GetPosition(), coll_object.transform.GetPosition()); } } // Decrease stamina ----------- DecreaseStamina(sec_ability_cost); }
public void UseSpellWeapon() { Fireball newSpellProjectile = Instantiate(fireballSpell, firePoint.position, firePoint.rotation) as Fireball; FindObjectOfType <CharacterControl>().PlayerLoseMana(spellStats[6]); FindObjectOfType <SpellSkillImage>().SetSpellCD(spellStats[5]); newSpellProjectile.SetProjectileSpeedz(spellStats[0]); newSpellProjectile.SetProjectileSpeedy(spellStats[1]); newSpellProjectile.SetProjectileRotationSpeed(spellStats[2]); newSpellProjectile.SetProjectileAreaDamage(spellStats[4]); newSpellProjectile.SetProjectileAreaRadius(spellStats[7]); newSpellProjectile.SetProjectileLifeTime(projectileLifeTime); if (spellMultiShot) { for (int i = 0; i < spellShotgunAmount; i++) { float random = Random.Range(-spellShotgunAmount, spellShotgunAmount); Vector3 spread = new Vector3(0, random, 0).normalized *spellConeSize; Quaternion projectileDirection = Quaternion.Euler(spread) * firePoint.rotation; Fireball spellShotGunProjectile = Instantiate(fireballSpell, firePoint.position, projectileDirection) as Fireball; spellShotGunProjectile.SetProjectileSpeedz(spellStats[0]); spellShotGunProjectile.SetProjectileSpeedy(spellStats[1]); spellShotGunProjectile.SetProjectileRotationSpeed(spellStats[2]); spellShotGunProjectile.SetProjectileAreaDamage(spellStats[4]); spellShotGunProjectile.SetProjectileAreaRadius(spellStats[7]); spellShotGunProjectile.SetProjectileLifeTime(projectileLifeTime); } } }
string GetAbilityDescription(int slot) { int id = pinfo.GetAbilityID(slot); string desc = ""; //Debug.Log("SLOT" + slot+"ID"+id); switch (id) { case 1: //frenzy Frenzy frenzy = (Frenzy)pinfo.abilities[slot]; frenzy.CalculateMult(); desc = frenzy.GetDescription(); break; case 2: //rage Rage rage = (Rage)pinfo.abilities[slot]; rage.CalculateMult(); desc = rage.GetDescription(); break; case 3: //Mine Mine mine = (Mine)pinfo.abilities[slot]; mine.CalculateDamage(); desc = mine.GetDescription(); break; case 4: //Mine Fireball fireball = (Fireball)pinfo.abilities[slot]; fireball.CalculateDamage(); desc = fireball.GetDescription(); break; } return(desc); }
void Hide() { PlatformGridObject[] boats = FindObjectsOfType <PlatformGridObject>(); // Destroy boats int i = 0; while (i < boats.Length) { boats[i].Destructor(); i++; } // Destroy fireballs i = 0; while (i < fireballs.Count) { Fireball fireball = fireballs[i]; fireballs.RemoveAt(i); if (fireball) { Destroy(fireball.gameObject); } } // Hide boss isInvulnerable = true; state = BossState.StartHide; // to stop idle animation StartCoroutine(HideAnimation()); }
public void CastProjectile() { Fireball fireballInstance = (Fireball)Instantiate(fireball, ProjectileSpawn.position, ProjectileSpawn.rotation); fireballInstance.Damage = CurrentDamage; fireballInstance.Direction = ProjectileSpawn.forward; }
void OnTriggerEnter2D(Collider2D other) { Wiz wiz = other.GetComponent <Wiz>(); Fireball fireball = other.GetComponent <Fireball>(); if (fireball != null && isShootable) { isActive = true; return; } if (wiz == null) { return; } wizardsHere++; if (wizardsHere >= wizardsNeeded) { sRender.sprite = activeSprite; isActive = true; if (m_level_name != null && m_level_name != "") { ((PizzaSpell)GameObject.Find("PizzaSpell").GetComponent <PizzaSpell>()).change_level(m_level_name); } } }
void Awake() { inCharge = false; onFire = false; if(currentMagic.tag == "Fireball"){ fireball = currentMagic.GetComponent<Fireball>(); coolDown = fireball.coolDown; } }
public override bool Execute(Fireball.Plugins.PluginApplication application) { _FunctionsHashTable = new Hashtable(); Stream stream = typeof(PHPPlugin).Assembly.GetManifestResourceStream("FirePHP.phpfunctions.ini"); StreamReader reader = new StreamReader(stream); while (!reader.EndOfStream) { string line = reader.ReadLine(); if (line != null) { string functionName = line.Substring(0, line.IndexOf('=')); string desc = line.Substring(line.IndexOf('=') + 1); _FunctionsHashTable.Add(functionName, desc); } } FireEditApplication editor = (FireEditApplication)application; editor.MainForm.NewCodeEditor += new EventHandler<NewCodeEditorEventArgs>(MainForm_NewCodeEditor); editor.MainForm.DockContainer.ActiveDocumentChanged += new EventHandler(DockContainer_ActiveDocumentChanged); phpToolBar = new PHPToolBar(); phpToolBar.Enabled = false; phpToolBar.Name = "PHPToolBar"; phpToolBar.Location = new System.Drawing.Point(editor.MainForm.MainToolStrip.Location.X + editor.MainForm.MainToolStrip.Width, editor.MainForm.MainToolStrip.Location.Y); editor.MainForm.TopToolStripPanel.Controls.Add(phpToolBar); ToolStripMenuItem mnuPHPHelp = new ToolStripMenuItem("PHP Docs"); mnuPHPHelp.Click += new EventHandler(mnuPHPHelp_Click); ToolStripMenuItem mnuHelp = (ToolStripMenuItem)editor.MainForm.MainMenuStrip.Items.Find("mnuHelp", false)[0]; mnuHelp.DropDownItems.Add("-"); mnuHelp.DropDownItems.Add(mnuPHPHelp); return true; }
void OnTriggerEnter(Collider other) { //Debug.Log("Trigger Entered " + other.GetType()); //player = gameObject.GetComponent<PlayerScript>(); collidingFireball = other.GetComponent<Fireball>(); collidingPlayer = other.GetComponent<PlayerScript>(); //Debug.Log("Trigger Entered " + collidingPlayer.GetType()); if(collidingFireball != null) { Debug.Log(collidingFireball.getPlayer().getControllerNumber() + " " + controller); if(collidingFireball.getPlayer().getControllerNumber() != controller){ Debug.Log("Destroyed this damn fireball and the person hit"); Destroy(this.gameObject); Destroy(other.gameObject); } } if(collidingPlayer !=null) { //Debug.Log("Collided Player"); if(collidingPlayer.getControllerNumber() != controller) { Debug.Log("Destroy player and ball"); Destroy(this.gameObject); Destroy(collidingPlayer.gameObject); }else //Debug.Log("EXITED"); return ; }else if(other.tag!="Ground"&&other.tag!="Lava") { Debug.Log("collides something else than ground!!!"); Destroy(this.gameObject); // }else if(other.tag=="Lava"){ // Walker scott; // if(other.GetComponent<Walker>()!=null){ // scott = other.GetComponent<Walker>();} // else{ // scott = this.GetComponent<Walker>(); // } // if(scott!=null){ // scott.isSafe(true); // } } }
public override bool Execute(Fireball.Plugins.PluginApplication application) { _Application = ((FireEditApplication)application); ToolStripItem mnuEdit = _Application.MainForm.MainMenuStrip.Items.Find("mnuEdit", false)[0]; int editMenuIndex = _Application.MainForm.MainMenuStrip.Items.IndexOf(mnuEdit); _BuildMenuItem = new ToolStripMenuItem("&Build"); _Application.MainForm.MainMenuStrip.Items.Insert(editMenuIndex + 1, _BuildMenuItem); _Application.MainForm.Text = "FireEdit For Gemix"; _ConfigureGemixItem = new ToolStripMenuItem("Configure GMX Compiler"); _ConfigureGemixItem.Click += new EventHandler(_ConfigureGemixItem_Click); _BuildMenuItem.DropDownItems.Add(_ConfigureGemixItem); _BuildMenuItem.DropDownItems.Add("-"); _BuildFileItem = new ToolStripMenuItem("Build PRG"); _BuildFileRunItem = new ToolStripMenuItem("Build PRG/RUN"); _BuildFileRunItem.Click += new EventHandler(_BuildFileRunItem_Click); _BuildFileItem.Click += new EventHandler(_BuildFileItem_Click); _BuildMenuItem.DropDownItems.Add(_BuildFileItem); _BuildMenuItem.DropDownItems.Add(_BuildFileRunItem); string configFile = Path.Combine(Application.StartupPath, "gemix.xml"); _Application.MainForm.DockContainer.ActiveDocumentChanged += new EventHandler(DockContainer_ActiveDocumentChanged); if (File.Exists(configFile)) { _ConfigDocument.Load(configFile); } else { _ConfigDocument.LoadXml("<gemix><compiler /></gemix>"); } return true; }
/// <summary> /// 编辑窗体添加断点 /// </summary> /// <param name="editForm">编辑窗体</param> /// <param name="row">断点所在行</param> private void EditFormBreakPointAdded(EditForm editForm, Fireball.Syntax.Row row) { bool exist = false; int currentLineIndex = -1; string fileName = null; foreach (DataGridViewRow breakPointRow in breakPointView.Rows) { fileName = breakPointRow.Cells["BreakPointFileName"].Value as string; string lineIndex = breakPointRow.Cells["BreakPointLineIndex"].Value as string; currentLineIndex = row.Index + 1; if (fileName == editForm.FileName && lineIndex == currentLineIndex.ToString()) { exist = true; break; } } if (!exist) { fileName = editForm.FileName; currentLineIndex = row.Index + 1; breakPointView.Rows.Add(1); DataGridViewRow newRow = breakPointView.Rows[breakPointView.Rows.Count - 1]; newRow.Cells["EnableBreakPoint"].Value = true; newRow.Cells["BreakPointFileName"].Value = fileName; newRow.Cells["BreakPointLineIndex"].Value = currentLineIndex.ToString(); // 动态注册断点 if (startDebug) { string message = string.Format("add_break_point {0} {1}", fileName, currentLineIndex.ToString()); PrintOutputText(string.Format("注册断点 —— 文件名:{0},行号:{1}", fileName, currentLineIndex.ToString())); string receivedMessage = SendAndWaitMessage(message, string.Format("<ldb>add_break_point: {0},{1}", fileName, currentLineIndex), false); if (receivedMessage != null) { newRow.Cells["BreakPointState"].Value = "注册成功"; newRow.Cells["BreakPointState"].Style.ForeColor = Color.Black; } else { receivedMessage = "接收消息超时..."; newRow.Cells["BreakPointState"].Value = "接收消息超时"; newRow.Cells["BreakPointState"].Style.ForeColor = Color.Red; } PrintOutputText(receivedMessage); } } }
/// <summary> /// 鼠标取词事件 /// </summary> /// <param name="sender">事件发送者</param> /// <param name="e">事件参数</param> private void luaEditBox_OnWordMouseHover(object sender, ref Fireball.Windows.Forms.CodeEditor.WordMouseEventArgs e) { Word hoveredWord = e.Word; if (e.Word.Index < e.Word.Row.Count - 1) // 行末尾的单词定位不准,暂时取消掉取词 { if (hoveredWord != lastHoveredWord) // 同一个单词只显示一次Tip就够了 { if (handleWordMouseHover != null) { handleWordMouseHover(this, ref e); } lastHoveredWord = hoveredWord; } } }
private void FireballExplode(Fireball fireball) { fireball.OnTouch(this); }
public FireballCollision(Fireball fb) { fireball = fb; }
internal FreeImageFormatInfo(Fireball.Drawing.Internal.FREE_IMAGE_FORMAT format) { _Extensions = GetAllExtensions(format); _Format = format; }
public override bool Execute(Fireball.Plugins.PluginApplication application) { return this.Execute(application, new object[0]); }
//must be call it after MoveFireballs(); public void CreateFireball(int firePower) { int arisePointX = isRightHeaded ? currentPositonX + mouthFromCenterX : currentPositonX - mouthFromCenterX; int arisePointY = currentPositonY - mouthFromCenterY; if (minPositonX <= arisePointX && arisePointX <= maxPositonX && frame == 7) { Fireball fireball = new Fireball(arisePointX, arisePointY, isRightHeaded, firePower); fireballs.Add(fireball); Console.ResetColor(); Console.ForegroundColor = ConsoleColor.Yellow; Console.SetCursorPosition(arisePointX, arisePointY); Console.WriteLine("*"); } }
protected override Skill MakeSkill(GamePadState playerController) { Skill newSkill = new Skill(); if (playerController.Buttons.A == ButtonState.Pressed) { newSkill = new Fireball(); } else if (playerController.Buttons.B == ButtonState.Pressed) { newSkill = new MultipleFireBall(); } else if (playerController.Buttons.Y == ButtonState.Pressed) { newSkill = new MegaFireBall(); } return newSkill; }
public override bool Execute(Fireball.Plugins.PluginApplication application, params object[] parameters) { return this.Execute(application); }
public void AddWord( Fireball.Syntax.Word word, Size wordSize ) { TextBlock tb = null; if (Children.Count == 0) { tb = new TextBlock() { Width = wordSize.Width, Height = wordSize.Height }; if (word != null) { Run run = new Run() { Text = word.Text, Foreground = (word.Style != null ? new SolidColorBrush(word.Style.ForeColor) : new SolidColorBrush(Colors.Transparent)) }; tb.Inlines.Add(run); } base.Children.Add(tb); tb.SetValue(Canvas.LeftProperty, 0.0d); } else { tb = base.Children[0] as TextBlock; Run run = new Run() { Text = word.Text, Foreground = (word.Style != null ? new SolidColorBrush(word.Style.ForeColor) : new SolidColorBrush(Colors.Transparent)) }; tb.Inlines.Add(run); tb.Width += wordSize.Width; } if( Width < tb.Width && tb != null ) Width = tb.Width; if (Height < tb.Height && tb != null) Height = tb.Height; }
// Use this for initialization public void Awake() { DontDestroyOnLoad(transform.gameObject); EquipmentFactory = new equipmentFactory(); if (Application.loadedLevelName == "setup") { previousScene = "setup"; Application.LoadLevel("OverworldBaseCamp"); } InfernalSpawn = (GameObject)Resources.Load("Enemy Prefabs/InfernalEnemy", typeof(GameObject)); #region ability initialization Abilities = new Dictionary<string, Ability>(); // Attack type, damage type, range, angle, cooldown, damagemod, resource cost #region player abilities #region spammed abilities Abilities["fireball"] = new Fireball(AttackType.PROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 0.0f, 10.0f, 0f, "fireball", "Fireball", FireballExplosion); Abilities["shadowbolt"] = new Shadowbolt(AttackType.HONINGPROJECTILE, DamageType.SHADOW, 10.0f, 0.0f, 0.0f, 1.0f, 0f, "shadowbolt", "Shadowbolt", ShadowboltExplosion); Abilities["improvedshadowbolt"] = new ImprovedShadowbolt(AttackType.HONINGPROJECTILE, DamageType.SHADOW, 10.0f, 0.0f, 0.0f, 1.0f, 0f, "improvedshadowbolt", "Improved Shadowbolt", ShadowboltExplosion); Abilities["poisonbolt"] = new Poisonbolt(AttackType.HONINGPROJECTILE, DamageType.POISON, 10.0f, 0.0f, 0.0f, 10.0f, 0f, "poisonbolt", "poisonbolt", FireballExplosion); Abilities["bloodbolt"] = new Bloodbolt(AttackType.HONINGPROJECTILE, DamageType.PHYSICAL, 10.0f, 0.0f, 0.0f, 10.0f, 0f, "bloodbolt", "bloodbolt", FireballExplosion); Abilities["chaosbolt"] = new Chaosbolt(AttackType.HONINGPROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 0.0f, 10.0f, 0f, "chaosbolt", "chaosbolt", ChaosboltExplosion); Abilities["chaosbarragebolt"] = new ChaosBarrageBolt(AttackType.HONINGPROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 0.0f, 10.0f, 0f, "chaosbarragebolt", "chaosbarragebolt", ChaosboltExplosion); Abilities["icebolt"] = new IceBolt(AttackType.PROJECTILE, DamageType.WATER, 8f, 0f, 0.0f, 10.0f, 0f, "icebolt", "Ice Bolt", IceBoltParticles); Abilities["cleave"] = new Cleave(AttackType.MELEE, DamageType.PHYSICAL, 3.0f, 45.0f, 0.0f, 5.0f, 0f, "cleave", "Cleave", CleaveParticles); Abilities["arrow"] = new Arrow(AttackType.PROJECTILE, DamageType.PHYSICAL, 8.0f, 0.0f, 0.0f, 5.0f, 0f, "arrow", "Arrow", ArrowParticles); #endregion #region buff abilities Abilities["chaosbarrage"] = new ChaosBarrageAbility(AttackType.STATUS, DamageType.NONE, 10.0f, 0.0f, 0.0f, 0.0f, 0, "chaosbarrage", "Chaos Barrage", ChaosBarrageParticles); Abilities["fireballbarrage"] = new FireballBarrageAbility(AttackType.STATUS, DamageType.NONE, 10.0f, 0.0f, 30.0f, 0.0f, 100f, "fireballbarrage", "Fireball Barrage", FireballBarrageParticles); Abilities["rootability"] = new RootAbility(AttackType.STATUS, DamageType.NONE, 10.0f, 360.0f, 15.0f, 0.0f, 0f, "rootability", "Root Ability", null); #endregion Abilities["groundslam"] = new Hadouken(AttackType.PBAOE, DamageType.AIR, 5.0f, 360.0f, 10.0f, 10.0f, 25.0f, "groundslam", "Ground Slam", HadoukenParticles); Abilities["deathgrip"] = new Deathgrip(AttackType.PBAOE, DamageType.SHADOW, 5.0f, 360.0f, 0.0f, 15.0f, 25.0f, "deathgrip", "AoE Deathgrip", DeathgripParticles); Abilities["fusrodah"] = new Fusrodah(AttackType.PBAOE, DamageType.AIR, 5.0f, 45.0f, 5.0f, 10.0f, 20.0f, "fusrodah", "Fus Roh Dah", FusRoDahParticles); Abilities["flamestrike"] = new Flamestrike(AttackType.PBAOE, DamageType.FIRE, 5.0f, 360.0f, 5.0f, 1000.0f, 25.0f, "flamestrike", "Flamestrike", FlamestrikeParticles); Abilities["bladewaltz"] = new BladeWaltz(AttackType.PBAOE, DamageType.PHYSICAL, 5.0f, 360.0f, 30.0f, 0f, 50.0f, "bladewaltz", "Blade Waltz", BladeWaltzParticles); Abilities["erenwaltz"] = new ErenWaltz(AttackType.PBAOE, DamageType.PHYSICAL, 5.0f, 360.0f, 0.0f, 5.0f, 0f, "erenwaltz", "Eren Waltz", BladeWaltzParticles); Abilities["firemine"] = new FireMine(AttackType.PROJECTILE, DamageType.FIRE, 5.0f, 360.0f, 4.0f, 200.0f, 10f, "firemine", "Fire Mine", FiremineParticles); Abilities["GETOVERHERE"] = new GETOVERHERE(AttackType.PROJECTILE, DamageType.SHADOW, 4.0f, 0.0f, 0.0f, 0.1f, 10f, "GETOVERHERE", "Shadow Pull", GETOVERHEREParticles); Abilities["normalmine"] = new NormalMine(AttackType.PROJECTILE, DamageType.PHYSICAL, 5.0f, 360.0f, 4.0f, 1.0f, 10f, "normalmine", "Mine", MineParticles); Abilities["blinkstrike"] = new BlinkStrike(AttackType.PROJECTILE, DamageType.SHADOW, 4.0f, 1.0f, 0.0f, 5.0f, 10f, "blinkstrike", "Blink Strike", BlinkStrikeExplosion); Abilities["blink"] = new Blink(AttackType.GROUNDTARGET, DamageType.NONE, 5.0f, 0.0f, 7.0f, 0.0f, 25f, "blink", "Blink", BlinkParticles); Abilities["shockmine"] = new ShockMine(AttackType.PROJECTILE, DamageType.PHYSICAL, 7.0f, 360.0f, 3.0f, 30.0f, 5f, "shockmine", "Shock Mine", ShockMineProjectile); Abilities["aoefreeze"] = new AOEfreeze(AttackType.PBAOE, DamageType.WATER, 5.0f, 360f, 15f, 1f, 30f, "aoefreeze", "Flashfreeze", AOEFreezeParticles); Abilities["onhitnormal"] = new OnHitNormal(AttackType.MELEE, DamageType.PHYSICAL, 0.0f, 0.0f, 0.0f, 0.0f, 0f, "onhitnormal", "On Hit Normal", OnHitNormalParticles); Abilities["onhitsworddrop"] = new OnHitSwordDrop(AttackType.MELEE, DamageType.PHYSICAL, 0f, 0f, 0f, 0f, 0f, "onhitsworddrop", "Sword Drop OnHit", OnHitSwordDropObject); Abilities["fireballturret"] = new FireballTurret(AttackType.PROJECTILE, DamageType.NONE, 10.0f, 360.0f, 2.0f, 0.0f, 40f, "fireballturret", "Fireball Turret", FireballTurretParticles); Abilities["fireballturretfireball"] = new FireballTurretFireball(AttackType.PROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 0.0f, 5.0f, 0f, "fireballturretfireball", "Fireball Turret Fireball", FireballExplosion); Abilities["frozenorb"] = new FrozenOrb(AttackType.PROJECTILE, DamageType.NONE, 5.0f, 360.0f, 8.0f, 0.0f, 30f, "frozenorb", "Frozen Orb", FrozenOrbParticles); Abilities["frozenorbicebolt"] = new IceBolt(AttackType.PROJECTILE, DamageType.WATER, 8f, 0f, 0.0f, 0f, 0f, "frozenorbicebolt", "Frozen Orb Ice Bolt", IceBoltParticles); Abilities["boomerangblade"] = new BoomerangBlade(AttackType.PROJECTILE, DamageType.PHYSICAL, 5f, 0f, 4.0f, 0f, 20f, "boomerangblade", "Boomerang Blade", BoomerangBladeExplosion); Abilities["boomerangbladereturn"] = new BoomerangBladeReturn(AttackType.HONINGPROJECTILE, DamageType.PHYSICAL, 0.0f, 0.0f, 0.0f, 0.0f, 0f, "boomerangbladereturn", "Boomerang Blade(returning)", BoomerangBladeExplosion); Abilities["axethrow"] = new AxeThrow(AttackType.PROJECTILE, DamageType.PHYSICAL, 5.0f, 0.0f, 2.0f, 0.0f, 3f, "axethrow", "Axe Throw", AxeThrowExplosion); Abilities["frostnova"] = new FrostNova(AttackType.PBAOE, DamageType.WATER, 7f, 360f, 20f, 0f, 60f, "frostnova", "Frost Nova", IceBoltParticles); Abilities["shieldbreaker"] = new ShieldBreaker(AttackType.PBAOE, DamageType.PHYSICAL, 10f, 15f, 0.0f, 5f, 20f, "shieldbreaker", "Shieldbreaker", ShieldBreakerParticles); Abilities["dropdasteel"] = new DropDaSteel(AttackType.STATUS, DamageType.NONE, 0f, 0f, 32f, 0f, 0f, "dropdasteel", "Drop Da Steel", dropdasteelparticles); Abilities["dervishdeathgrip"] = new Deathgrip(AttackType.PBAOE, DamageType.NONE, 3f, 360f, 0f, 0f, 0f, "dervishdeathgrip", "Dervish Deathgrip", DeathgripParticles); Abilities["infernalfireball"] = new InfernalFireball(AttackType.HONINGPROJECTILE, DamageType.FIRE, 5.0f, 360.0f, 5.0f, 30.0f, 0f, "infernalfireball", "Infernal Fireball", InfernalFireballExplosion); Abilities["whirlwind"] = new Whirlwind(AttackType.GROUNDTARGET, DamageType.PHYSICAL, 3.0f, 360.0f, 0.0f, 10.0f, 0f, "whirlwind", "Whirlwind", OnHitNormalParticles); Abilities["dervish"] = new Dervish(AttackType.GROUNDTARGET, DamageType.PHYSICAL, 5f, 360f, 0.0f, 10f, 100f, "dervish", "Dervish", OnHitNormalParticles); Abilities["bossinfernalfireball"] = new BossInfernalFireball(AttackType.HONINGPROJECTILE, DamageType.FIRE, 5.0f, 360.0f, 5.0f, 30.0f, 0f, "bossinfernalfireball", "Boss Infernal Fireball", BossInfernalFireballExplosion); //Abilities["healorb"] = new HealOrb(AttackType.PROJECTILE, DamageType.NONE, 5.0f, 360.0f, 0.0f, 0.0f, "healorb", "Heal Orb", HealOrbExplosion); Abilities["deathanddecay"] = new DeathAndDecay(AttackType.GROUNDTARGET, DamageType.SHADOW, 5.0f, 360.0f, 0.0f, 1.0f, 0f, "deathanddecay", "Death and Decay", DeathAndDecaySpawn); Abilities["shadowfury"] = new Shadowfury(AttackType.GROUNDTARGET, DamageType.SHADOW, 3.0f, 360.0f, 0.0f, 1.0f, 0f, "shadowfury", "Shadowfury", ShadowfurySpawn); Abilities["shadowtrap"] = new Shadowtrap(AttackType.GROUNDTARGET, DamageType.SHADOW, 3.0f, 360.0f, 0.0f, 0.0f, 0f, "shadowtrap", "Shadowtrap", ShadowtrapSpawn); #endregion #region enemy abilities Abilities["enemyfireball"] = new Fireball(AttackType.PROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 4f, 10.0f, 0f, "enemyfireball", "Enemy Fireball", FireballExplosion); Abilities["enemycleaveslow"] = new Cleave(AttackType.MELEE, DamageType.PHYSICAL, 3.0f, 45.0f, 3.0f, 5.0f, 0f, "cleave", "Cleave", CleaveParticles); Abilities["enemycleavenormal"] = new Cleave(AttackType.MELEE, DamageType.PHYSICAL, 3.0f, 45.0f, 2f, 2.5f, 0f, "cleave", "Cleave", CleaveParticles); Abilities["enemycleavefast"] = new Cleave(AttackType.MELEE, DamageType.PHYSICAL, 3.0f, 45.0f, 1.0f, 1.0f, 0f, "cleave", "Cleave", CleaveParticles); Abilities["enemydeathgrip"] = new Deathgrip(AttackType.PBAOE, DamageType.SHADOW, 10.0f, 360.0f, 10.0f, 0.0f, 0.0f, "enemydeathgrip", "Enemy Deathgrip", DeathgripParticles); Abilities["bossfireball"] = new BossFireball(AttackType.PROJECTILE, DamageType.FIRE, 10.0f, 0.0f, 5.0f, 10.0f, 0f, "bossfireball", "Boss Fireball", BossInfernalFireballExplosion); Abilities["bossflamestrike"] = new BossFlamestrike(AttackType.PBAOE, DamageType.FIRE, 10.0f, 360.0f, 10.0f, 10.0f, 0.0f, "bossflamestrike", "Boss Flamestrike", BossFlamestrikeParticles); Abilities["enemywhirlwind"] = new Whirlwind(AttackType.GROUNDTARGET, DamageType.PHYSICAL, 3.0f, 360.0f, 8.0f, 5.0f, 0f, "enemywhirlwind", "Enemy Whirlwind", OnHitNormalParticles); #endregion #endregion }
public void AddWord(int row, Fireball.Syntax.Word word, Size wordSize) { ScrollRowCanvas sr = row >= 0 && row <= ElementContent.Children.Count-1 ? ElementContent.Children[row] as ScrollRowCanvas: null; if (sr == null) AddRow(); sr = ElementContent.Children[row] as ScrollRowCanvas; sr.AddWord(word, wordSize); if (CellHeight < sr.Height) CellHeight = (int)sr.Height; }
/// <summary> /// 编辑窗体删除断点 /// </summary> /// <param name="editForm">编辑窗体</param> /// <param name="row">断点所在行</param> private void EditFormBreakPointRemoved(EditForm editForm, Fireball.Syntax.Row row) { int removeRowIndex = -1; string fileName = null; int currentLineIndex = row.Index + 1; foreach (DataGridViewRow breakPointRow in breakPointView.Rows) { fileName = breakPointRow.Cells["BreakPointFileName"].Value as string; string lineIndex = breakPointRow.Cells["BreakPointLineIndex"].Value as string; if (fileName == editForm.FileName && lineIndex == currentLineIndex.ToString()) { removeRowIndex = breakPointRow.Index; break; } } if (removeRowIndex != -1) { breakPointView.Rows.RemoveAt(removeRowIndex); // 动态取消注册断点 if (startDebug) { string message = string.Format("delete_break_point {0} {1}", fileName, currentLineIndex.ToString()); PrintOutputText(string.Format("取消注册断点 —— 文件名:{0},行号:{1}", fileName, currentLineIndex.ToString())); string receivedMessage = SendAndWaitMessage(message, string.Format("<ldb>delete_break_point: {0},{1}", fileName, currentLineIndex.ToString()), false); if (receivedMessage != null) { receivedMessage = "取消注册断点成功..."; } else { receivedMessage = "接收消息超时..."; } PrintOutputText(receivedMessage); } } }
// Use this for initialization void Start() { playerData = GameObject.Find("PlayerData"); lockSpells = warlock.transform.FindChild("Spells"); lockStatus = playerData.GetComponent<Variables>(); fireball = lockSpells.GetComponent<Fireball>(); fireblast = lockSpells.GetComponent<Fireblast>(); teleport = lockSpells.GetComponent<Teleport>(); windblast = lockSpells.GetComponent<Windblast>(); gui = GameObject.FindGameObjectWithTag("GUI").GetComponent<drawGUI>(); smartCast = false; }
/// <summary> /// 删除断点事件 /// </summary> /// <param name="sender">事件发送者</param> /// <param name="e">事件参数</param> private void luaEditBox_OnBreakPointRemoved(object sender, Fireball.Syntax.RowEventArgs e) { if (handleBreakPointRemoved != null) { handleBreakPointRemoved(this, e.Row); } }
private static string[] GetAllExtensions(Fireball.Drawing.Internal.FREE_IMAGE_FORMAT format) { var exts = FreeImageApi.GetFIFExtensionList(format); return exts.Split(new string[]{","}, StringSplitOptions.RemoveEmptyEntries); }
public static Fireball GetFireBall() { Dictionary<AnimationKey, Animation> animations = new Dictionary<AnimationKey, Animation>(); Animation animation = new Animation(3, 32, 32, 0, 0); animations.Add(AnimationKey.Down, animation); animation = new Animation(3, 32, 32, 0, 32); animations.Add(AnimationKey.Left, animation); animation = new Animation(3, 32, 32, 0, 64); animations.Add(AnimationKey.Right, animation); animation = new Animation(3, 32, 32, 0, 96); animations.Add(AnimationKey.Up, animation); Fireball fireBall = new Fireball(SceneGraph, FireBallTexture, animations); fireBall.SetCollisionSize(32, 32); return fireBall; }
public override bool Execute(Fireball.Plugins.PluginApplication application, params object[] parameters) { ((FireEditApplication)application).MainForm.NewCodeEditor += new EventHandler<NewCodeEditorEventArgs>(MainForm_NewCodeEditor); return true; }