Skip to content

Randboss Subclass System

yutio888 requested to merge yutio888/t-engine4:randboss_revision into master

This merge request modifies the current generation of random rares, uniques & bosses, in the form called "subclasses". This helps handle conflicting weapons, reduce the dangerous stacking of passives & sustains from different classes, and making randbosses have more related talent sets & equipments.

Changes

  1. Add the new subclass system for randboss generation. Note that the old randboss generation system is kept for compatibility, that any class without useful subclasses will use the old system instead.
  2. Add a function checkWeaponCompatible in GameState.lua to check if the new subclass is compatible with previous subclasses in weapon. This can be superloaded for DLCs/addons.
  3. resolveLevel is called for randbosses eariler, to reduce the extra stat gained from equipment auto-req at birth, besides, slightly reduce the auto-resist during level-up (which I think should be removed totally anyway).
  4. Define at least one useable subclass for each class in main game and current DLCs (Related MRs are in DLCs' repo). Note that I'm not very good at naming subclasses, and some classes are really hard to divide into subclasses. Definitions might need some revise later.
  5. Miscs: adjust several flags for talents, add new resolvers.generic_randboss for special handling, etc.

Subclass Definition

Subclasses should be defined by newBirthDescriptor, and the relation between a class and its subclasses should be defined in descriptor_choices.randboss_choices. See afflicted.lua or any other class definition file.

The type of random boss subclasses should be randboss, and the copy part of the original class is discarded.

Several important flags in subclass definition:

  1. name: the name of subclass, need translation
  2. desc: not displayed anyway, still needed.
  3. base_type: not neccessary now, maybe useful later
  4. weapon_type: can be anything you like, but must be processable by checkWeaponCompatible.
  5. copy: mainly equipment, but can add any resolver you need
  6. copy_add: adjust life rating here, if not defined use the life rating of original class instead
  7. stats: adjust level-up auto stats, if not defined use the stats for original class instead
  8. talent_types : defines the main talent trees of this subclass, that it will try to learn all talents by default. See Talent Type Description section below.
  9. random_talent_types: defines the secondary talent trees, these are randomly selected, and the number of talents learnt is randomly decided. See Talent Type Description section below.
  10. talents: define some key talents besides the talent tree selection. See Talent Description section below.

Talent Type Description:

Talent type can be described in its name, or in a more complex table. The table contains several possible flags:
a. name: must be the name of this talent type
b. randmax: only useful in talent_types, means the number of talents from this tree randboss can learn is randomly decided
c. chance: the chance table to learn talents in the format of `{a, b, c}`, where a means the chance to learn all talents, b means the chance to learn t1~t3, c means the chance to learn t1~t2
d. max: the maximum tier of talents randboss can learn from this tree

Talent Description

a. key: the short name of the talent
b. values:
   1. base: the base talent level
   2. every: gain one talent level after such levels
   3. start_lv: start to gain additional talent level from this level
   4. max: the maximum talent level
   5. random_factor: the multiplier of rng, ranges from (1-random_factor) to (1+random_factor), cannot beyond max.

Merge request reports