Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ public SummonedSnake(double focusLevelModifier = 0.0) : base()
Summoned = true;
}

private (int health, int defense) GetSnakeStats()
private (int health, int defense, double poisonStrength, int attackLevel) GetSnakeStats()
{
var player = Director;
var level = player.Level;
attackLevel = Math.Max(8,player.Level - 10);
// Focus level is a multiplier for the stats of the pet.
double focusLevel = 1;
var magicSkill = player.GetSkillLevel(Skill.Magic);
var focusItems = player.Paperdoll.OfType<IPetFocus>().ToList();
var focusItems2 = player.Rings.OfType<IPetFocus>().ToList();
var allFocusItems = focusItems.Concat(focusItems2).ToList();
poisonStrength = Math.Max(1, magicSkill - 10);
Copy link
Copy Markdown
Collaborator

@n099y n099y Jan 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this just overwriting the parameter ?
image

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a tuple, so it's just defining the variables that the method will return when it's called.
it's initially whatever the default value for double is until we make it equal to the Math.max stuff at the bottom.


// Search for and get the highest focus level from the items.
if (allFocusItems.Count > 0)
Expand All @@ -37,17 +38,28 @@ public SummonedSnake(double focusLevelModifier = 0.0) : base()
if (_focusLevelModifier != 0)
focusLevel += _focusLevelModifier;

var health = (level + (int)magicSkill)* 5 * focusLevel;
var defense = (level) * focusLevel;
var health = (player.level + (int)magicSkill)* 5 * focusLevel;
var defense = player.level * focusLevel;
poisonStrength *= focusLevel;

return ((int)health,(int)defense);
return ((int)health,(int)defense,poisonStrength,attackLevel);
}

public override void OnEnterWorld()
{
base.OnEnterWorld();

var (health, defense) = GetSnakeStats();
var (health, defense, poisonStrength, attackLevel) = GetSnakeStats();

Attacks = new CreatureAttackCollection
{
{
new CreatureAttack(attackLevel, 5, 15, "The snake strikes you."), 60
},
{
new CreatureAttack(attackLevel, 5, 15, "The snake strikes you with its fangs, injecting venom.", new AttackPoisonComponent((int)poisonStrength)), 40
},
};

Health = MaxHealth = health;
BaseDodge = defense;
Expand Down