public void UpdatePlan() { if (!canSpawn) { return; } if (bursts.Count >= 1 && timer > bursts[bursts.Count - 1].time) { // Spawn burst Burst burst = bursts[bursts.Count - 1]; for (int i = 0; i < burst.enemies.Count; i++) { Vector2 vieportSpawnPosition = burst.position; vieportSpawnPosition.x += ((Random.Range(0, 2) == 0) ? 1 : -1) * Random.Range(0.01f, 0.1f); vieportSpawnPosition.x = Mathf.Clamp01(vieportSpawnPosition.x); vieportSpawnPosition.y += ((Random.Range(0, 2) == 0) ? 1 : -1) * Random.Range(0.01f, 0.1f); vieportSpawnPosition.y = Mathf.Clamp01(vieportSpawnPosition.y); Vector3 burstPos = room.ViewportToWorldPoint(vieportSpawnPosition); GameObject enemy = EnemyFactory.getInstance().InstantiateEnemy(burst.enemies[i], burstPos, Quaternion.identity); enemy.GetComponent <AICoreUnity.MovementAI>().target = Globals.GetPlayer().GetComponent <Rigidbody2D>(); spawnedEnemies.Add(enemy.GetComponent <Enemy>()); } bursts.RemoveAt(bursts.Count - 1); if (bursts.Count == 0) { hasSpawnedEverything = true; } } timer += Time.deltaTime; }
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { Burst b = (Burst)value; object[] values = new object[] { b.Time, b.Amount }; return(values); }
// Main Game loop IEnumerator BurstLoop() { // Loop endlessly (until the player dies) while (true) { // If we aren't at our limit for how many pipes the player has to face at once .. if (burstPipeCount < maxBurstCount) { // set a flag that we haven't yet found a pipe that willwork bool pipeHasBurst = false; do { // Get random pipe reference via random index Burst targetPipe = burstPoints[Random.Range(0, burstPoints.Length)]; // if this pipe in not currently active .. if (targetPipe.burst == false) { // .. Make it so and set flag to move on targetPipe.StartBurst(); burstPipeCount++; pipeHasBurst = true; } } while (pipeHasBurst == false); } // Wait before bursting the next pipe float timeInterval = Random.Range(minTimeInterval, maxTimeInterval); yield return(new WaitForSeconds(timeInterval)); } }
void RandomEvent() { if (Random.Range(0, 100) < 5) { if (_rain.IsAlive() || _snow.IsAlive()) { Burst burst = cloud1.emission.GetBurst(0); burst.maxCount = 10; cloud1.emission.SetBurst(0, burst); cloud2.emission.SetBurst(0, burst); _snow.Stop(); _rain.Stop(); Debug.Log("rain stop"); } else { Burst burst = cloud1.emission.GetBurst(0); burst.maxCount = 30; cloud1.emission.SetBurst(0, burst); cloud2.emission.SetBurst(0, burst); if (Random.Range(0, 100) < 90) { _rain.Play(); Debug.Log("rain"); } else { Debug.Log("snow"); _snow.Play(); } } } }
/// <summary> /// Create VGO_PS_EmissionModule from EmissionModule. /// </summary> /// <param name="module"></param> /// <returns></returns> protected virtual VGO_PS_EmissionModule CreateVgoModule(EmissionModule module) { var vgoModule = new VGO_PS_EmissionModule() { enabled = module.enabled, rateOverTime = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.rateOverTime), rateOverTimeMultiplier = module.rateOverTimeMultiplier, rateOverDistance = VgoParticleSystemMinMaxCurveConverter.CreateFrom(module.rateOverDistance), rateOverDistanceMultiplier = module.rateOverDistanceMultiplier, //BurstCount = module.burstCount, }; if (module.burstCount > 0) { Burst[] bursts = new Burst[module.burstCount]; module.GetBursts(bursts); if ((bursts != null) && bursts.Any()) { vgoModule.bursts = new VGO_PS_Burst[bursts.Length]; for (int idx = 0; idx < bursts.Length; idx++) { vgoModule.bursts[idx] = VgoParticleSystemBurstConverter.CreateFrom(bursts[idx]); } } } return(vgoModule); }
private static void OnTick(EventArgs args) { PermaActive.Execute(); if (Activemode(Orbwalker.ActiveModes.Combo)) { switch (Mode) { case 1: Combo.Execute(); break; case 2: Burst.Execute(); break; } } if (Activemode(Orbwalker.ActiveModes.JungleClear)) { Jungle.Execute(); } if (Activemode(Orbwalker.ActiveModes.LaneClear)) { Lane.Execute(); } if (Activemode(Orbwalker.ActiveModes.Flee)) { Flee.Execute(); } }
public void FireBurst(Vector3 direction, GameObject bulletPrefab) { Vector3 quaternionDefaultVector = new Vector3(0, 1, 0); Vector3 translatedPosition = direction - Position; Vector3 zAxis = new Vector3(0, 0, 1); float middleRay = Vector3.SignedAngle( quaternionDefaultVector, translatedPosition, zAxis ); float bulletRotation; Quaternion bulletDirection; Vector3 radiusAddition; Burst currentBurst = Bursts[CurrentBurstIndex]; for (int i = 0; i < currentBurst.shots.Count; i++) { bulletRotation = middleRay + currentBurst.shots[i]; bulletDirection = Quaternion.Euler(0, 0, bulletRotation); radiusAddition = bulletDirection * (new Vector3(0, 0.2f, 0)); Instantiate(bulletPrefab, radiusAddition + Position, bulletDirection); } Cooldown = currentBurst.cooldown; }
public override void OnInspectorGUI() { serializedObject.Update(); EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins, new GUILayoutOption[0]); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button(new GUIContent("Random"), EditorStyles.miniButton, GUILayout.Width(110f))) { ((AttackType)target).rate = Random.Range(1f, 10f); int nb = Random.Range(1, 10); ((AttackType)target).bursts.Clear(); for (int i = 0; i < nb; i++) { Burst b = new Burst(); b.amount = Random.Range(1, 15); b.angle = Random.Range(0, 360); b.spread = Random.Range(0, 360); b.prefab = (GameObject)EditorGUIUtility.Load("Assets/Prefabs/Bullets/AgiBullet.prefab"); ; ((AttackType)target).bursts.Add(b); } } GUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical(EditorStyles.inspectorFullWidthMargins, new GUILayoutOption[0]); drawGUI(); EditorGUILayout.EndVertical(); EditorGUILayout.BeginVertical(EditorStyles.inspectorDefaultMargins, new GUILayoutOption[0]); EditorGUILayout.EndVertical(); serializedObject.ApplyModifiedProperties(); }
void EmitAfterSet(int count) { Profiler.BeginSample("Emit now"); //If the particles actually die at some point, track them if (Energy.Max > 0 && !Manager.NoSimulation) { var b = new Burst { amount = count, time = Manager.RealTime, life = Energy.Max }; m_burstsDone.Enqueue(b); } int emitOffset = (Offset + ParticleCount) % Manager.MaxParticles; m_currentEmitBind.Offset = emitOffset; m_currentEmitBind.Count = count; DispatchEmitExtensionKernel(ComputeShader, EmitKernel); ParticleCount += count; if (OnEmissionCallback != null) { OnEmissionCallback(count); } Profiler.EndSample(); }
private void OnCollisionEnter2D(Collision2D collision) { gameObject.GetComponent <CircleCollider2D>().enabled = false; if (collision.gameObject.name == "TT2" || collision.gameObject.name == "TT1") { EnemyText.GetComponent <ParticleSystem>().Play(true); } if (collision.gameObject.name == "TT1") { ActionController.GetComponent <Actions>().Die("TT1"); } else if (collision.gameObject.name == "TT2") { ActionController.GetComponent <Actions>().Die("TT2"); } else { Burst.GetComponent <ParticleSystem>().Play(true); Alien.SetActive(false); StartCoroutine(Die()); ActionController.GetComponent <Actions>().PopIt(); } }
public object Clone() { Burst burst = new Burst(); burst.unlocked = this.unlocked; burst.unlockedAt = this.unlockedAt; return(burst); }
protected void FireBurster(float velocity) { CurrentBurst = GameProvider.FireBurster(SelfFaction, transform.position, Achievement, velocity); if (ShouldSound) { SoundManager.GetInstance().BurstSound.Play(); } }
public UserPacket(RadioID id, bool data, bool group, RadioID source, RadioID target, bool encrypted, bool phone, UInt32 groupTag, Burst b) : this(data, group) { this.id = id; this.src = source; this.dest = target; this.encrypted = encrypted; this.phone = phone; this.groupTag = groupTag; this.burst = b; }
/// <summary> /// Create VGO_PS_Burst from Burst. /// </summary> /// <param name="minMaxCurve"></param> /// <returns></returns> public static VGO_PS_Burst CreateFrom(Burst burst) { return(new VGO_PS_Burst() { time = burst.time, count = VgoParticleSystemMinMaxCurveConverter.CreateFrom(burst.count), cycleCount = burst.cycleCount, repeatInterval = burst.repeatInterval, probability = burst.probability, }); }
internal static void Init(EventArgs args) { QADelay.Init(); if (W.Level > 0) { W.Range = Me.HasBuff("RivenFengShuiEngine") ? 330 : 260; } if (Me.IsDead) { qStack = 0; return; } if (qStack != 0 && Utils.TickCount - lastQTime > 3800) { qStack = 0; } if (Me.IsRecalling()) { return; } KeepQ.Init(); KillSteal.Init(); switch (Orbwalker.ActiveMode) { case Orbwalking.OrbwalkingMode.Combo: Combo.Init(); break; case Orbwalking.OrbwalkingMode.Burst: Burst.Init(); break; case Orbwalking.OrbwalkingMode.Mixed: Harass.Init(); break; case Orbwalking.OrbwalkingMode.LaneClear: LaneClear.Init(); JungleClear.Init(); break; case Orbwalking.OrbwalkingMode.Flee: Flee.Init(); break; } }
public static void AdvancedBurst() { //The generic burst takes a vertex factory, edge factory and identity provider. //Pass the default implementation of any parameters you want default behaviour for //The factory and identity provider implementations must match the identity type of the chain (eg Guid) Burst <Guid> burstHelper = new Burst <Guid>(new StatefulVertexFactory <VertexState>(new EnumState(VertexState.HEALTHY)), new DefaultEdgeFactory(), new DefaultIdentityProvider()); //The identity type must be specified because type inference can't help here BurstInfo <Guid> burst = burstHelper.Create(10, false); //The graph representing the clique is the Graph property Graph <Guid> burstGraph = burst.Graph; }
public static void BaiscBurst() { //The non-generic burst is an implementation of Burst<Guid> //which uses DefaultVertexFactory, DefaultEdgeFactory and DefaultIdentityProvider Burst burstHelper = new Burst(); //The identity type must be specified because type inference can't help here BurstInfo <Guid> burst = burstHelper.Create(10, false); //Can get the vertex at the centre of the burst from the CentreVertex property Vertex <Guid> centreVertex = burst.CentreVertex; //Can get the graph representing the chain from the Graph property Graph <Guid> burstGraph = burst.Graph; }
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) { Burst b = new Burst(); if (float.TryParse(values[0].ToString(), out b.Time) == false) { return(new Burst()); } if (int.TryParse(values[1].ToString(), out b.Amount) == false) { return(new Burst()); } return(b); }
public void SetParticleValues(ParticleSystem ps) { if (ps != null) { var main = ps.main; var emissionModule = ps.emission; int oldMaxParticles = main.maxParticles; float oldRateOverTime = emissionModule.rateOverTime.constant; Burst oldBurst = emissionModule.GetBurst(0); emissionModule = ps.emission; emissionModule.rateOverTime = new MinMaxCurve(oldRateOverTime * particleSlider); emissionModule.SetBurst(0, new Burst(0, oldBurst.count.constant * particleSlider)); main.maxParticles = (int)(oldMaxParticles * particleSlider); } }
protected void draw_banner_scene(SpriteBatch sprite_batch) { // Title Screen Background Title_Back.draw(sprite_batch); // Title Background Darken sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null); Title_Black.draw(sprite_batch); sprite_batch.End(); // Class Banner Effect banner_shader = Global.effect_shader(); if (banner_shader != null) { banner_shader.CurrentTechnique = banner_shader.Techniques["Technique2"]; banner_shader.Parameters["color_shift"].SetValue(Class_Banner_Color.ToVector4()); } sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, banner_shader); Class_Banner.draw(sprite_batch); sprite_batch.End(); // Letters if (Letters.Count > 0) { if (banner_shader != null) { banner_shader.CurrentTechnique = banner_shader.Techniques["Technique2"]; banner_shader.Parameters["color_shift"].SetValue(Letters[0].flash.ToVector4()); } sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.PointClamp, null, null, banner_shader); foreach (Spiral_Letter letter in Letters) { letter.draw(sprite_batch); } sprite_batch.End(); } if (Burst != null) { sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null); Burst.draw(sprite_batch); sprite_batch.End(); } }
private void ReceiveDamage(Burst burst) { if (Model.Faction != Faction.None && burst.Faction != Model.Faction) { var distance = (Model.Position - burst.transform.position.To2D()).magnitude; var damage = 1 + (75 - Model.Mitigation) / (distance + 1) / 2; Debug.Log("Portal " + Model + "receiving damage " + damage + " from distance " + distance + " with mitigation " + Model.Mitigation); ReduceEnergy(damage); if (Energy == 0) { DestroyerAchievement = burst.OwnerAchievement; if (burst.Faction == Faction.Player) { SoundManager.GetInstance().PortalDestroyedSound.Play(); } } } }
public static void SetBurstMode(int index) { switch (index) { case 1: BurstMode = Burst.Vocal; break; case 2: BurstMode = Burst.Dance; break; case 3: BurstMode = Burst.Visual; break; default: BurstMode = Burst.None; break; } }
public static void OnPostAttack(object sender, PostAttackEventArgs args) { if (Game.TickCount - Extensions.LastQCastAttempt <= 340 + Game.Ping / 2) { Extensions.DidJustAuto = false; return; } Extensions.DidJustAuto = true; if (MenuConfig.BurstMode.Active) { Burst.OnProcessAutoAttack(); } else { switch (Global.Orbwalker.Mode) { case OrbwalkingMode.Combo: ComboManager.OnProcessAutoAttack(); break; case OrbwalkingMode.Mixed: Harass.OnProcessAutoAttack(); break; case OrbwalkingMode.Laneclear: if (args.Target.IsMinion) { Lane.OnProcessAutoAttack(); Jungle.OnProcessAutoAttack(args.Target as Obj_AI_Minion); } else if ((args.Target as Obj_AI_Base).IsBuilding() && SpellConfig.Q.Ready) { SpellConfig.Q.Cast(Global.Player.ServerPosition.Extend(args.Target.ServerPosition, 100)); } break; } } }
void EmitAfterSet(int count) { Profiler.BeginSample("Emit now"); //If the particles actually die at some point, track them if (Energy.Max > 0 && !Manager.NoSimulation) { var b = new Burst { amount = count, time = Manager.RealTime, life = Energy.Max }; m_burstsDone.Enqueue(b); } Manager.NumParticles += count; ComputeShader.SetInt("numToGo", count); int dispatch = Mathf.CeilToInt(count / (float)GroupSize); Manager.SetPariclesToKernel(ComputeShader, EmitKernel); ComputeShader.Dispatch(EmitKernel, dispatch, 1, 1); Profiler.EndSample(); }
public UserPacket(byte[] data) : base(data) { this.src = new RadioID(data, 6, 3); this.dest = new RadioID(data, 9, 3); this.calltype = data[12]; //This seems to be some kind of group tag to help group packets together this.groupTag = (UInt32)((data[13] << 24) | (data[14] << 16) | (data[15] << 8) | data[16]); this.encrypted = ((data[17] & 0x80) != 0); this.end = ((data[17] & 0x40) != 0); this.timeslot = ((data[17] & 0x20) != 0); this.phone = ((data[17] & 0x10) != 0); //RTP Data... this.rtp = new RTPData(data, 18); //Burst data... if (this.rtp.Extension) { throw new Exception("Have a header extenstion! Don't know how to process packet!"); } else { this.burst = Burst.Decode(data.Skip(30).ToArray()); } }
private void SetEmission(EmissionModule emModule) { Burst burst = emModule.GetBurst(0); OriginalEmits.Add(burst); }
public BurstRemoveCommand(ParticleSystem instance, Burst b) { this.instance = instance; burst = b; Description = "Remove burst"; }
public BurstAddCommand(ParticleSystem instance, Burst b) { this.instance = instance; burst = b; Description = "Add burst"; }
public static void Load() { Principal = MainMenu.AddMenu("Championship Riven", "Riven"); Principal.AddLabel("Championship Riven v" + Assembly.GetExecutingAssembly().GetName().Version); Principal.AddSeparator(2); Principal.AddLabel("Good game !"); Combo = Principal.AddSubMenu("Combo", "Combo"); Combo.AddSeparator(3); Combo.AddLabel("• Spells Combo"); Combo.Add("UseQCombo", new CheckBox("Use Q?")); Combo.Add("UseWCombo", new CheckBox("Use W?")); Combo.Add("UseECombo", new CheckBox("Use E")); Combo.Add("UseRCombo", new CheckBox("Use R?")); Combo.Add("UseR2Combo", new CheckBox("Use R2?")); Combo.AddSeparator(3); Combo.AddLabel("• Spell W"); Combo.Add("W/Auto", new Slider("Auto W if {0} Enemies <=", 2, 1, 5)); Combo.AddSeparator(3); Combo.AddLabel("• Spell R"); Combo.Add("UseRType", new ComboBox("Use R when", 1, "Normal Kill", "Hard Kill", "Always", "ForceR")); Combo.Add("ForceR", new KeyBind("Force R", false, KeyBind.BindTypes.PressToggle, 'U')); Combo.Add("DontR1", new Slider("Dont R if Target HP {0}% <=", 25, 10, 50)); Combo.AddSeparator(3); Combo.AddLabel("• Spell R2"); Combo.Add("UseR2Type", new ComboBox("Use R2 when", 0, "Kill only", "Max damage")); Shield = Principal.AddSubMenu("Shield", "Shield"); Shield.AddLabel("• Spell E"); foreach (var Enemy in EntityManager.Heroes.Enemies) { Shield.AddLabel(Enemy.ChampionName); Shield.Add("E/" + Enemy.BaseSkinName + "/Q", new CheckBox(Enemy.ChampionName + " (Q)", false)); Shield.Add("E/" + Enemy.BaseSkinName + "/W", new CheckBox(Enemy.ChampionName + " (W)", false)); Shield.Add("E/" + Enemy.BaseSkinName + "/E", new CheckBox(Enemy.ChampionName + " (E)", false)); Shield.Add("E/" + Enemy.BaseSkinName + "/R", new CheckBox(Enemy.ChampionName + " (R)", false)); Shield.AddSeparator(1); } Burst = Principal.AddSubMenu("Burst", "Burst"); Burst.AddLabel("• Burst"); Burst.AddLabel("The combo burst key is the Combo !"); Burst.AddLabel("This 'Burst allowed' option is just to confirm that you want to use the Burst"); Burst.AddSeparator(2); Burst.Add("BurstAllowed", new KeyBind("Burst Allowed ?", false, KeyBind.BindTypes.PressToggle, 'T')); Burst.Add("BurstType", new ComboBox("Burst:", 0, "Damage Check", "Always")); Burst.AddSeparator(2); Burst.AddLabel("Select Burst style"); Burst.AddLabel("Style Burst 1: E > Flash > R > W > Hydra > R2"); Burst.AddLabel("Style Burst 2: E > R > Flash > W > Hydra > R2"); Burst.AddSeparator(1); Burst.Add("BurstStyle", new Slider("Burst style", 1, 1, 2)); Items = Principal.AddSubMenu("Items", "Items"); Items.AddLabel("• Hydra Logic"); Items.Add("Hydra", new CheckBox("Use Hydra?")); Items.Add("HydraReset", new CheckBox("Use hydra to reset your AA")); Items.AddSeparator(3); Items.AddLabel("• Tiamat Logic"); Items.Add("Tiamat", new CheckBox("Use Tiamat?")); Items.Add("TiamatReset", new CheckBox("Use the Tiamat to reset your AA")); Items.AddSeparator(3); Items.AddLabel("• Qss / Mercurial Logic"); Items.Add("Qss", new CheckBox("Use Qss?")); Items.Add("QssCharm", new CheckBox("Use Qss because of charm")); Items.Add("QssFear", new CheckBox("Use Qss because of fear")); Items.Add("QssTaunt", new CheckBox("Use Qss because of taunt")); Items.Add("QssSuppression", new CheckBox("Use Qss because of suppression")); Items.Add("QssSnare", new CheckBox("Use Qss because of snare")); Items.AddSeparator(3); Items.AddLabel("• Youmu Logic"); Items.Add("Youmu", new CheckBox("Use Youmu?")); Items.Add("YoumuHealth", new Slider("Use Youmu if the enemy has less than {0} HP", 65, 25, 100)); Laneclear = Principal.AddSubMenu("Laneclear", "Laneclear"); Laneclear.Add("UseQLane", new CheckBox("Use Q")); Laneclear.Add("UseWLane", new CheckBox("Use W")); Laneclear.Add("UseWLaneMin", new Slider("Use W if you hit {0} minions", 3, 0, 10)); Jungleclear = Principal.AddSubMenu("Jungleclear", "Jungleclear"); Jungleclear.Add("UseQJG", new CheckBox("Use Q")); Jungleclear.Add("UseWJG", new CheckBox("Use W")); Jungleclear.Add("UseEJG", new CheckBox("Use E")); Jungleclear.Add("Level_1 JungleClearing", new CheckBox("only attack small Red/BLUE")); Flee = Principal.AddSubMenu("Flee", "Flee"); Flee.Add("UseQFlee", new CheckBox("Use Q")); Flee.Add("UseEFlee", new CheckBox("Use E")); Misc = Principal.AddSubMenu("Misc", "Misc"); Misc.Add("Skin", new CheckBox("Skinhack ?", false)); Misc.Add("SkinID", new Slider("Skin ID: {0}", 4, 0, 6)); Misc.Add("Interrupter", new CheckBox("Interrupter ?")); Misc.Add("InterrupterW", new CheckBox("Interrupter with W ?")); Misc.Add("Gapcloser", new CheckBox("Gapcloser ?")); Misc.Add("GapcloserW", new CheckBox("Use W on Gapcloser ?")); Misc.Add("BrokenAnimations", new CheckBox("Broken Animations ?")); Draw = Principal.AddSubMenu("Drawing", "Drawing"); Draw.Add("DrawQ", new CheckBox("Draw Q")); Draw.Add("DrawW", new CheckBox("Draw W")); Draw.Add("DrawE", new CheckBox("Draw E")); Draw.Add("DrawR", new CheckBox("Draw R2")); Draw.Add("DrawDamage", new CheckBox("Draw Damage")); Draw.Add("DrawOFF", new CheckBox("Draw OFF", false)); }
extern public void SetBurst(int index, Burst burst);