Exemple #1
0
        public CombatDebugOverlay(Actor self)
        {
            healthInfo = self.Info.TraitInfoOrDefault <HealthInfo>();
            coords     = Exts.Lazy(self.Trait <BodyOrientation>);

            debugVis = self.World.WorldActor.TraitOrDefault <DebugVisualizations>();
        }
Exemple #2
0
        public Health(ActorInitializer init, HealthInfo info)
        {
            Info  = info;
            MaxHP = info.HP > 0 ? info.HP : 1;

            hp = init.Contains <HealthInit>() ? init.Get <HealthInit, int>() * MaxHP / 100 : MaxHP;

            DisplayHP = hp;
        }
Exemple #3
0
        public CombatDebugOverlay(Actor self)
        {
            healthInfo = self.Info.TraitInfoOrDefault <HealthInfo>();
            coords     = Exts.Lazy(self.Trait <BodyOrientation>);

            var localPlayer = self.World.LocalPlayer;

            devMode = localPlayer != null?localPlayer.PlayerActor.Trait <DeveloperMode>() : null;
        }
        public Health(ActorInitializer init, HealthInfo info)
        {
            Info  = info;
            MaxHP = info.HP > 0 ? info.HP : 1;

            // Cast to long to avoid overflow when multiplying by the health
            hp = init.Contains <HealthInit>() ? (int)(init.Get <HealthInit, int>() * (long)MaxHP / 100) : MaxHP;

            DisplayHP = hp;
        }
Exemple #5
0
        public CombatDebugOverlay(Actor self)
        {
            healthInfo = self.Info.TraitInfoOrDefault <HealthInfo>();
            blockInfo  = self.Info.TraitInfoOrDefault <BlocksProjectilesInfo>();
            attack     = Exts.Lazy(() => self.TraitOrDefault <AttackBase>());
            coords     = Exts.Lazy(() => self.Trait <BodyOrientation>());

            var localPlayer = self.World.LocalPlayer;

            devMode = localPlayer != null?localPlayer.PlayerActor.Trait <DeveloperMode>() : null;
        }
Exemple #6
0
        public Health(ActorInitializer init, HealthInfo info)
        {
            Info  = info;
            MaxHP = hp = info.HP > 0 ? info.HP : 1;

            // Cast to long to avoid overflow when multiplying by the health
            var healthInit = init.GetOrDefault <HealthInit>();

            if (healthInit != null)
            {
                hp = (int)(healthInit.Value * (long)MaxHP / 100);
            }

            DisplayHP = hp;
        }