tuxemon.formula module

tuxemon.formula.check_taste(monster, stat)[source]

It checks the taste and return the value

Parameters:
  • monster (Monster) –

  • stat (str) –

Return type:

int

tuxemon.formula.convert_ft(cm)[source]

It converts centimeters into feet.

Parameters:

cm (float) –

Return type:

float

tuxemon.formula.convert_km(steps)[source]

It converts steps into kilometers. One tile: 1 meter

Parameters:

steps (float) –

Return type:

float

tuxemon.formula.convert_lbs(kg)[source]

It converts kilograms into pounds.

Parameters:

kg (float) –

Return type:

float

tuxemon.formula.convert_mi(steps)[source]

It converts steps into miles.

Parameters:

steps (float) –

Return type:

float

tuxemon.formula.damage_full_hp(target, value)[source]

Damage based on target’s full hp.

Parameters:
  • target (Monster) – The one the technique is being used on.

  • value (int) – Numerical value (target.hp // value).

Returns:

Inflicted damage.

Return type:

int

tuxemon.formula.escape(level_user, level_target, attempts)[source]
Parameters:
  • level_user (int) –

  • level_target (int) –

  • attempts (int) –

Return type:

bool

tuxemon.formula.set_height(cm)[source]

It generates a personalized height, random number: between +/- 10%. Eg 100 cm +/- 10 cm

Parameters:

cm (float) –

Return type:

float

tuxemon.formula.set_weight(kg)[source]

It generates a personalized weight, random number: between +/- 10%. Eg 100 kg +/- 10 kg

Parameters:

kg (float) –

Return type:

float

tuxemon.formula.simple_damage_calculate(technique, user, target)[source]

Calculates the damage of a technique based on stats and multiplier.

Parameters:
  • technique (Technique) – The technique to calculate for.

  • user (Monster) – The user of the technique.

  • target (Monster) – The one the technique is being used on.

Returns:

A tuple (damage, multiplier).

Return type:

Tuple[int, float]

tuxemon.formula.simple_damage_multiplier(attack_types, target_types)[source]

Calculates damage multiplier based on strengths and weaknesses.

Parameters:
  • attack_types (Sequence[Element]) – The types of the technique.

  • target_types (Sequence[Element]) – The types of the target.

Returns:

The attack multiplier.

Return type:

float

tuxemon.formula.simple_grabbed(monster)[source]
Parameters:

monster (Monster) –

Return type:

None

tuxemon.formula.simple_lifeleech(user, target)[source]

Simple lifeleech based on a few factors.

Parameters:
  • technique – The technique causing lifeleech.

  • user (Monster) – The user of the technique.

  • target (Monster) – The one the technique is being used on.

Returns:

Inflicted damage.

Return type:

int

tuxemon.formula.simple_recover(target)[source]

Simple recover based on target’s full hp.

Parameters:
  • technique – The technique causing recover.

  • target (Monster) – The one being healed.

Returns:

Recovered health.

Return type:

int

tuxemon.formula.simple_stuck(monster)[source]
Parameters:

monster (Monster) –

Return type:

None

tuxemon.formula.today_ordinal()[source]

It gives today’s proleptic Gregorian ordinal.

Return type:

int

tuxemon.formula.weight_height_diff(monster, db)[source]
Parameters:
  • monster (Monster) –

  • db (MonsterModel) –

Return type:

Tuple[float, float]