Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttackSkill ¶
type BaseEntity ¶
BaseEntity 实体的基本接口,包含被框架托管的必须方法
type Card ¶
type Card interface { BaseEntity Type() enum.CardType Cost() map[enum.ElementType]uint }
type Character ¶
type Character interface { GetID() (id uint64) GetOwner() (owner uint64) GetAffiliation() (affiliation enum.Affiliation) GetVision() (element enum.ElementType) GetWeaponType() (weaponType enum.WeaponType) GetSkills() (skills []uint64) GetHP() (hp uint) GetMaxHP() (maxHP uint) GetMP() (mp uint) GetMaxMP() (maxMP uint) GetEquipment(equipmentType enum.EquipmentType) (equipped bool, equipment uint64) GetSatiety() (satiety bool) GetAttachedElements() (elements []enum.ElementType) GetStatus() (status enum.CharacterStatus) GetLocalModifiers(modifierType enum.ModifierType) (modifiers []uint64) }
Character 供外部包调用的角色接口
type CooperativeSkill ¶
type CooperativeSkill interface { Skill BaseDamage() *context.DamageContext EffectLeft() uint Effective() bool }
type Cost ¶
type Cost struct {
// contains filtered or unexported fields
}
func NewCostFromMap ¶
func NewCostFromMap(m map[enum.ElementType]uint) *Cost
NewCostFromMap 从一个map创建Cost
type EquipmentCard ¶
type EquipmentCard interface { Card EquipmentType() enum.EquipmentType Modify() (event Event) }
func ConvertToEquipmentCard ¶
func ConvertToEquipmentCard(original Card) (success bool, result EquipmentCard)
type Event ¶
type Event interface { BaseEntity TriggerAt() enum.TriggerType CanTriggered(context.CallbackContext) bool NeedClear() bool Callback(*context.CallbackContext) }
type EventCard ¶
func ConvertToEventCard ¶
type GameOptions ¶
type GameOptions struct { ReRollTimes uint // ReRollTimes 所有玩家的基础可重掷次数 StaticCost map[enum.ElementType]uint // StaticCost 所有玩家的基础固定持有骰子 RollAmount uint // RollAmount 所有玩家的投掷阶段生成元素骰子数量 GetCards uint // GetCards 所有玩家在回合开始时可以获得的卡牌数量 SwitchCost map[enum.ElementType]uint // SwitchCost 切换角色所需要的消费 }
type PassiveSkill ¶
type PassiveSkill interface { }
type Player ¶
type Player interface { GetUID() (uid uint64) GetCost() (cost map[enum.ElementType]uint) GetCards() (cards []uint64) GetSummons() (summons []uint64) GetSupports() (supports []uint64) CardDeckRemain() (remain uint) GetActiveCharacter() (character uint64) GetBackgroundCharacters() (characters []uint64) GetCharacter(character uint64) (has bool, entity Character) GetStatus() (status enum.PlayerStatus) GetGlobalModifiers(modifierType enum.ModifierType) (modifiers []uint64) GetCooperativeSkills(trigger enum.TriggerType) (skills []uint64) GetEvents(trigger enum.TriggerType) (events []uint64) }
Player 供外部包调用的玩家接口
type ReactionCalculator ¶
type ReactionCalculator interface { // ReactionCalculate 计算当前角色身上附着的元素之间能否发生反应,返回反应类型和剩余元素 ReactionCalculate([]enum.ElementType) (reaction enum.Reaction, elementRemains []enum.ElementType) // DamageCalculate 根据反应类型计算对应的伤害修正 DamageCalculate(reaction enum.Reaction, targetCharacter Character, ctx *context.DamageContext) // EffectCalculate 根据反应类型计算对应的反应效果 EffectCalculate(reaction enum.Reaction, targetPlayer Player) (ctx *context.CallbackContext) // Attach 尝试让新元素附着在现有元素集合内,此时不触发元素反应,返回尝试附着后的元素集合 Attach(originalElements []enum.ElementType, newElement enum.ElementType) (resultElements []enum.ElementType) // Relative 判断某种反应是否是某元素的相关反应 Relative(reaction enum.Reaction, relativeElement enum.ElementType) bool }
type RuleSet ¶
type RuleSet struct { ID uint64 ReactionCalculator ReactionCalculator VictorCalculator VictorCalculator }
func (RuleSet) ImplementationCheck ¶
type Skill ¶
type Skill interface { BaseEntity Type() enum.SkillType }
type SupportCard ¶
func ConvertToSupportCard ¶
func ConvertToSupportCard(original Card) (success bool, result SupportCard)
type VictorCalculator ¶
type WeaponCard ¶
type WeaponCard interface { EquipmentCard WeaponType() enum.WeaponType }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.