pub struct OverlordLogic { /* private fields */ }Implementations§
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_equip_ability( &self, slot_id: u64, ability_id: AbilityId, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_unequip_ability( &self, slot_id: AbilitySlotId, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_equip_abilities( &self, equipped_abilities: EquippedAbilities, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn make_cast_effect_action( &self, entity_id: EntityId, effect_id: EffectId, ) -> EntityAction
pub fn make_start_cast_ability_action( &self, by_entity_id: EntityId, ability_id: AbilityId, ) -> EntityAction
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_enable_auto_chest( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_disable_auto_chest( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_enable_auto_chest_filter( &self, filter_id: AutoChestFilterId, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_disable_auto_chest_filter( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_enable_auto_chest_power_compare( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_disable_auto_chest_power_compare( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_update_auto_chest_batch_size( &self, batch_size: i64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_new_auto_chest_filter( &self, filter: AutoChestFilter, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_update_auto_chest_filter( &self, updated_filter: AutoChestFilter, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_remove_auto_chest_filter( &self, filter_id: AutoChestFilterId, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_add_bundle_group( &self, bundle_ids: &[BundleId], source: CurrencySource, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
pub fn is_battle_active(&self, state: &OverlordState) -> bool
pub fn handle_prepare_fight( &mut self, prepare_fight_type: PrepareFightType, rand_gen: StdRng, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_start_fight( &mut self, event: OverlordEvent, fight_id: Uuid, _rand_gen: StdRng, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn get_prepare_fight_delay( &self, is_win: bool, chapter: &Chapter, state: &OverlordState, ) -> u64
pub fn get_end_fight_delay(&self, fight_id: FightTemplateId) -> u64
pub fn handle_afk_rewards_gating_unlocked( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_end_fight( &mut self, fight_id: Uuid, is_win: bool, pvp_state: Option<&PVPState>, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_run_cheat( &mut self, cheat: &Cheat, current_tick: u64, rand_gen: StdRng, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_spawn_entity( &self, id: EntityId, entity_template_id: EntityTemplateId, position: Coordinates, team: EntityTeam, has_big_hp_bar: bool, entity_attributes: EntityAttributes, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_start_move( &mut self, entity_id: Uuid, to: Coordinates, duration_ticks: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_move_progress( &self, entity_id: Uuid, to: Coordinates, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_end_move( &self, entity_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_entity_stun( &mut self, entity_id: Uuid, duration_ticks: u64, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_entity_cancel_cast_with_cooldown( &mut self, entity_id: Uuid, ability_id: Uuid, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_entity_add_ability_cooldown( &mut self, entity_id: Uuid, ability_id: Uuid, delta_ticks: i64, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_entity_incr_attribute( &mut self, entity_id: Uuid, attribute: &str, delta: i64, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_entity_apply_effect( &mut self, entity_id: Uuid, effect_id: Uuid, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_cast_effect( &mut self, entity_id: Uuid, effect_id: Uuid, caller_event: Option<Box<OverlordEvent>>, rand_gen: StdRng, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_start_cast_ability( &mut self, _event: OverlordEvent, by_entity_id: Uuid, ability_id: AbilityId, rand_gen: StdRng, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_cast_ability( &mut self, _event: OverlordEvent, by_entity_id: Uuid, to_entity_id: Uuid, ability_id: AbilityId, rand_gen: StdRng, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_start_cast_projectile( &mut self, _event: OverlordEvent, by_entity_id: Uuid, to_entity_id: Uuid, projectile_id: Uuid, level: i64, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_cast_projectile( &mut self, _event: OverlordEvent, by_entity_id: Uuid, to_entity_id: Uuid, projectile_id: Uuid, level: i64, projectile_data: &CustomEventData, rand_gen: StdRng, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_player_death( &mut self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_entity_death( &mut self, entity_id: Uuid, reward: Vec<CurrencyUnit>, rand_gen: StdRng, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_heal( &self, entity_id: Uuid, heal: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_damage( &self, entity_id: Uuid, damage: u64, current_tick: u64, rand_gen: StdRng, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_fight_progress( &mut self, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_set_max_hp( &mut self, entity_id: EntityId, new_max_hp: u64, new_hp: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_send_gift( &self, receiver_id: Uuid, config_gift_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_new_gift( &self, new_gift: Gift, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_accept_gift( &self, gift_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
Sourcepub fn pre_event(&mut self, event: &OverlordEvent, current_tick: u64)
pub fn pre_event(&mut self, event: &OverlordEvent, current_tick: u64)
Per-event pre-amble: stamps the combat clock so relative schedule
calls made anywhere in the dispatch resolve against the current tick,
and records the currency source label for the next compute_fields
diff. Called by handle_event and by the monolith’s merged
(logic + persistence) arms, which bypass this dispatch.
Sourcepub fn effect_subscription_events(
&self,
event: &OverlordEvent,
state: &OverlordState,
) -> Vec<EventPluginized<OverlordEvent, OverlordState>>
pub fn effect_subscription_events( &self, event: &OverlordEvent, state: &OverlordState, ) -> Vec<EventPluginized<OverlordEvent, OverlordState>>
Effect events_subscribe scan: when a fight is active, effects applied
to entities can react to any event by casting. The returned events are
appended to the handling result’s events (after the success hooks).
Sourcepub fn apply_success_hooks(
&self,
state: &mut OverlordState,
events: &mut Vec<EventPluginized<OverlordEvent, OverlordState>>,
event: &OverlordEvent,
)
pub fn apply_success_hooks( &self, state: &mut OverlordState, events: &mut Vec<EventPluginized<OverlordEvent, OverlordState>>, event: &OverlordEvent, )
Cross-cutting success hooks: quest progress + offer triggers. Runs for every successfully handled event, both here and in the monolith’s merged arms.
pub fn handle_event( &mut self, event: &OverlordEvent, state: OverlordState, rand_gen: StdRng, current_tick: u64, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn collect_due_scheduled(&mut self, current_tick: u64) -> Vec<OverlordEvent>
pub fn compute_fields( &self, state: &mut OverlordState, prev_state: &OverlordState, ) -> Vec<OverlordEvent>
Source§impl OverlordLogic
impl OverlordLogic
pub fn new( game_config: SharedGameConfig, behaviors: Arc<BehaviorRegistry>, frontend: bool, ) -> Self
Sourcepub fn set_last_currency_source(&mut self, source: Option<CurrencySource>)
pub fn set_last_currency_source(&mut self, source: Option<CurrencySource>)
Sets the source label used by log_currency_change_metrics for the next
compute_fields diff. Use when state mutations happen outside the normal
CurrencyIncrease / CurrencyDecrease event flow (e.g., starter bundle
seeding on character creation).
Sourcepub fn set_game_config(&mut self, game_config: SharedGameConfig)
pub fn set_game_config(&mut self, game_config: SharedGameConfig)
Swaps the config this logic reads from. Locale-translated configs only differ in localized strings, so swapping mid-session is safe — used by the backend to switch a connection to the user’s localized GameConfig once their language is known after auth.
pub fn handle_set_custom_value( &self, key: String, value: i64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_new_character_level( &self, level: i64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_noop( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_tutorial_step_completed( &self, step_number: i16, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
pub fn compute_character_level( &self, state: &mut OverlordState, ) -> Vec<OverlordEvent>
pub fn get_quest_progress( &self, character_state: &CharacterState, active_fight: &Option<ActiveFight>, quest: &QuestInstance, progress_script_native: Option<&str>, trigger_event: &OverlordEvent, game_config: &GameConfig, ) -> Result<i64>
pub fn handle_currency_increase( &self, currencies: &[CurrencyUnit], state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_currency_decrease( &self, currencies: &[CurrencyUnit], state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Sourcepub fn currency_increase(
currencies: &[CurrencyUnit],
currency_source: CurrencySource,
) -> EventPluginized<OverlordEvent, OverlordState>
pub fn currency_increase( currencies: &[CurrencyUnit], currency_source: CurrencySource, ) -> EventPluginized<OverlordEvent, OverlordState>
Creates a CurrencyIncrease event. The actual state mutation happens when the
event is processed by the handler — callers don’t need to mutate state manually.
Sourcepub fn currency_decrease(
state: &OverlordState,
currencies: &[CurrencyUnit],
currency_consumer: CurrencyConsumer,
) -> Option<EventPluginized<OverlordEvent, OverlordState>>
pub fn currency_decrease( state: &OverlordState, currencies: &[CurrencyUnit], currency_consumer: CurrencyConsumer, ) -> Option<EventPluginized<OverlordEvent, OverlordState>>
Creates a CurrencyDecrease event after validating sufficient balance.
Returns None if the player doesn’t have enough currency.
The actual state mutation happens when the event is processed by the handler.
pub fn handle_show_bird( &mut self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_bird_shown( &mut self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_rate_us_shown( &mut self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_open_item_case( &self, batch_size: i64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_auto_chest_open_item_case( &self, batch_size: i64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_player_new_items( &self, items: &[Item], state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_player_equip_item( &self, item_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_sell_item( &self, item_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_enable_auto_sell( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_disable_auto_sell( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_set_gear_override_enabled( &self, item_type: ItemType, enabled: bool, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_enable_case_upgrade_pop_up( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_disable_case_upgrade_pop_up( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_reset_offers( &self, new_offers: &[Offer], state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_equip_pet( &self, slot_id: u64, pet_id: PetId, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn build_pet_combat_state( &self, state: &OverlordState, ) -> (Option<ActivePetAbility>, Option<PetId>)
pub fn handle_unequip_pet( &self, slot_id: PetSlotId, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_equip_pets( &self, equipped_pets: EquippedPets, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_claim_quest( &mut self, quest_id: Uuid, rand_gen: StdRng, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_new_quests( &self, quest_ids: Vec<Uuid>, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_update_active_loop_task_id( &self, quest_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_patron_quest_completed( &self, quest_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_claim_quest_progression_reward( &self, quest_group_type: QuestGroupType, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_reset_repeating_quests( &self, quest_ids: Vec<Uuid>, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_claim_referral_lvlup_reward( &self, level: i64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_claim_referral_daily_reward( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_referral_daily_reward_status_update( &self, referral_daily_reward_status: bool, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Source§impl OverlordLogic
impl OverlordLogic
Sourcepub fn handle_claim_talent_research(
&self,
state: OverlordState,
) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_claim_talent_research( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Apply completed talent: increment level and clear upgrade timer fields.
Source§impl OverlordLogic
impl OverlordLogic
pub fn handle_new_task( &self, new_task: VassalTask, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_give_resist_task( &self, new_task: VassalTask, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_accept_task( &self, task_id: Uuid, is_good: bool, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_task_accepted( &self, task_id: Uuid, started_good: bool, started_at: DateTime<Utc>, finish_at: DateTime<Utc>, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_resist_task_accepted( &self, resist_task: VassalTask, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_hit_hands( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_catch_resist_task( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_hands_hitted( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_resist_task_catched( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_finish_task( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_resist_task_finished( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_claim_task_reward( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_claim_resist_task_reward( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_new_suzerain( &self, new_suzerain: Option<Suzerain>, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
pub fn handle_remove_vassal( &self, vassal_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OverlordLogic
impl !RefUnwindSafe for OverlordLogic
impl Send for OverlordLogic
impl Sync for OverlordLogic
impl Unpin for OverlordLogic
impl !UnwindSafe for OverlordLogic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].