Esempio n. 1
0
 public ObstacleEntity(Combat.Alignment alignment, bool actor, int maxHealth,
                       string name = "Obstacle", Visual.CharacterAppearanceData appearance = null, ElementalAffinity affinity = null, Date?birth = null, int?health = null)
 {
     this.alignment = alignment;
     this.actor     = actor;
     this.maxHealth = maxHealth;
     this.name      = name;
     // optional parameters
     if (appearance != null)
     {
         this.appearance = appearance;
     }
     else
     {
         this.appearance = Visual.CharacterAppearanceData.Random();
     }
     if (affinity != null)
     {
         this.affinity = affinity;
     }
     else
     {
         this.affinity = ElementalAffinity.RandomAffinity();
     }
     if (health.HasValue)
     {
         this.health = health.Value;
     }
     else
     {
         this.health = maxHealth;
     }
     //TODO: SkillHandler.FillSkills(this);
 }
Esempio n. 2
0
    public Node2D GenerateOnWithOutline(CanvasItem node, Combat.Alignment alignment)
    {
        Node2D appearance   = GenerateOn(node);
        Color  outlineColor = alignment switch
        {
            Combat.Alignment.FRIENDLY => FRIENDLY_COLOR,
            Combat.Alignment.HOSTILE => HOSTILE_COLOR,
            _ => NEUTRAL_COLOR,
        };

        (appearance?.Material as ShaderMaterial)?.SetShaderParam("outline", outlineColor);
        return(appearance);
    }