public override EffectLayer Render(IGameState state) { if (isPlayingKillStreakAnimation && Utils.Time.GetMillisecondsSinceEpoch() >= ks_end_time) { isPlayingKillStreakAnimation = false; } EffectLayer killstreak_layer = new EffectLayer("Dota 2 - Killstreak"); if (state is GameState_Dota2) { GameState_Dota2 dota2state = state as GameState_Dota2; if (current_kill_count < dota2state.Player.Kills) { isPlayingKillStreakAnimation = true; ks_end_time = Utils.Time.GetMillisecondsSinceEpoch() + ks_duration; } current_kill_count = dota2state.Player.Kills; if (dota2state.Player.KillStreak >= 2) { Color ks_color = getKillStreakColor(dota2state.Player.KillStreak); killstreak_layer.Fill(Utils.ColorUtils.BlendColors(Color.Transparent, ks_color, getKSEffectValue())); } } return(killstreak_layer); }
public override EffectLayer Render(IGameState state) { EffectLayer respawn_layer = new EffectLayer("Dota 2 - Respawn"); if (state is GameState_Dota2) { GameState_Dota2 dota2state = state as GameState_Dota2; if (dota2state.Player.Team != PlayerTeam.Undefined && dota2state.Player.Team != PlayerTeam.None && !dota2state.Hero.IsAlive) { double percent = (dota2state.Hero.SecondsToRespawn > 5 ? 0.0 : 1.0 - (dota2state.Hero.SecondsToRespawn / 5.0)); respawn_layer.Fill(Utils.ColorUtils.BlendColors(Color.Transparent, Properties.BackgroundColor, percent)); respawn_layer.PercentEffect(Properties.RespawningColor, Properties.RespawnColor, Properties.Sequence, percent, 1.0, PercentEffectType.AllAtOnce); } } return(respawn_layer); }
public override EffectLayer Render(IGameState state) { EffectLayer bg_layer = new EffectLayer("Dota 2 - Background"); if (state is GameState_Dota2) { GameState_Dota2 dota2state = state as GameState_Dota2; if (dota2state.Previously.Hero.HealthPercent == 0 && dota2state.Hero.HealthPercent == 100 && !dota2state.Previously.Hero.IsAlive && dota2state.Hero.IsAlive) { isDimming = false; dim_bg_at = dota2state.Map.GameTime + (Global.Configuration.ApplicationProfiles["Dota 2"].Settings as Dota2Settings).bg_dim_after; dim_value = 1.0; } Color bg_color = this.Properties.DefaultColor; switch (dota2state.Player.Team) { case PlayerTeam.Dire: bg_color = this.Properties.DireColor; break; case PlayerTeam.Radiant: bg_color = this.Properties.RadiantColor; break; default: break; } if (dota2state.Player.Team == PlayerTeam.Dire || dota2state.Player.Team == PlayerTeam.Radiant) { if (dim_bg_at <= dota2state.Map.GameTime || !dota2state.Hero.IsAlive) { isDimming = true; bg_color = Utils.ColorUtils.MultiplyColorByScalar(bg_color, getDimmingValue()); } else { isDimming = false; dim_value = 1.0; } } bg_layer.Fill(bg_color); } return(bg_layer); }
public override EffectLayer Render(IGameState state) { EffectLayer abilities_layer = new EffectLayer("Dota 2 - Abilities"); if (state is GameState_Dota2) { GameState_Dota2 dota2state = state as GameState_Dota2; if (Properties.AbilityKeys.Count >= 6) { for (int index = 0; index < dota2state.Abilities.Count; index++) { Ability ability = dota2state.Abilities[index]; if (ability.Name.Contains("seasonal") || ability.Name.Contains("high_five")) { continue; } Devices.DeviceKeys key = Properties.AbilityKeys[index]; if (ability.IsUltimate) { key = Properties.AbilityKeys[5]; } if (ability.CanCast && ability.Cooldown == 0 && ability.Level > 0) { abilities_layer.Set(key, Properties.CanCastAbilityColor); } else if (ability.Cooldown <= 5 && ability.Level > 0) { abilities_layer.Set(key, Utils.ColorUtils.BlendColors(Properties.CanCastAbilityColor, Properties.CanNotCastAbilityColor, (double)ability.Cooldown / 5.0)); } else { abilities_layer.Set(key, Properties.CanNotCastAbilityColor); } } } } return(abilities_layer); }
public override void ResetGameState() { _game_state = new GameState_Dota2(); }
public override EffectLayer Render(IGameState state) { EffectLayer items_layer = new EffectLayer("Dota 2 - Items"); if (state is GameState_Dota2) { GameState_Dota2 dota2state = state as GameState_Dota2; if (Properties.ItemKeys.Count >= 6) { for (int index = 0; index < dota2state.Items.InventoryCount; index++) { Item item = dota2state.Items.GetInventoryAt(index); Devices.DeviceKeys key = Properties.ItemKeys[index]; if (item.Name.Equals("empty")) { items_layer.Set(key, Properties.EmptyItemColor); } else { if (Properties.UseItemColors && item_colors.ContainsKey(item.Name)) { if (!String.IsNullOrWhiteSpace(item.ContainsRune)) { items_layer.Set(key, Utils.ColorUtils.BlendColors(item_colors[item.Name], bottle_rune_colors[item.ContainsRune], 0.8)); } else { items_layer.Set(key, item_colors[item.Name]); } } else { items_layer.Set(key, Properties.ItemsColor); } //Cooldown if (item.Cooldown > 5) { items_layer.Set(key, Utils.ColorUtils.BlendColors(items_layer.Get(key), Properties.ItemCooldownColor, 1.0)); } else if (item.Cooldown > 0 && item.Cooldown <= 5) { items_layer.Set(key, Utils.ColorUtils.BlendColors(items_layer.Get(key), Properties.ItemCooldownColor, item.Cooldown / 5.0)); } //Charges if (item.Charges == 0) { items_layer.Set(key, Utils.ColorUtils.BlendColors(items_layer.Get(key), Properties.ItemNoChargersColor, 0.7)); } } } for (int index = 0; index < dota2state.Items.StashCount; index++) { Item item = dota2state.Items.GetStashAt(index); Devices.DeviceKeys key = Properties.ItemKeys[6 + index]; if (item.Name.Equals("empty")) { items_layer.Set(key, Properties.EmptyItemColor); } else { if (Properties.UseItemColors && item_colors.ContainsKey(item.Name)) { if (!String.IsNullOrWhiteSpace(item.ContainsRune)) { items_layer.Set(key, Utils.ColorUtils.BlendColors(item_colors[item.Name], bottle_rune_colors[item.ContainsRune], 0.8)); } else { items_layer.Set(key, item_colors[item.Name]); } } else { items_layer.Set(key, Properties.ItemsColor); } //Cooldown if (item.Cooldown > 5) { items_layer.Set(key, Utils.ColorUtils.BlendColors(items_layer.Get(key), Properties.ItemCooldownColor, 1.0)); } else if (item.Cooldown > 0 && item.Cooldown <= 5) { items_layer.Set(key, Utils.ColorUtils.BlendColors(items_layer.Get(key), Properties.ItemCooldownColor, item.Cooldown / 5.0)); } //Charges if (item.Charges == 0) { items_layer.Set(key, Utils.ColorUtils.BlendColors(items_layer.Get(key), Properties.ItemNoChargersColor, 0.7)); } } } } } return(items_layer); }