Struct OverlordLogic

Source
pub struct OverlordLogic { /* private fields */ }

Implementations§

Source§

impl OverlordLogic

Source

pub fn handle_equip_ability( &self, slot_id: u64, ability_id: AbilityId, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_unequip_ability( &self, slot_id: AbilitySlotId, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_equip_abilities( &self, equipped_abilities: EquippedAbilities, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn make_cast_effect_action( &self, entity_id: EntityId, effect_id: EffectId, ) -> EntityAction

Source

pub fn make_start_cast_ability_action( &self, by_entity_id: EntityId, ability_id: AbilityId, ) -> EntityAction

Source§

impl OverlordLogic

Source§

impl OverlordLogic

Source§

impl OverlordLogic

Source

pub fn is_battle_active(&self, state: &OverlordState) -> bool

Source

pub fn handle_prepare_fight( &mut self, prepare_fight_type: PrepareFightType, rand_gen: StdRng, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_start_fight( &mut self, event: OverlordEvent, fight_id: Uuid, _rand_gen: StdRng, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn get_prepare_fight_delay( &self, is_win: bool, chapter: &Chapter, state: &OverlordState, ) -> u64

Source

pub fn get_end_fight_delay(&self, fight_id: FightTemplateId) -> u64

Source

pub fn handle_afk_rewards_gating_unlocked( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

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

Source

pub fn handle_run_cheat( &mut self, cheat: &Cheat, current_tick: u64, rand_gen: StdRng, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source§

impl OverlordLogic

Source

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>

Source

pub fn handle_start_move( &mut self, entity_id: Uuid, to: Coordinates, duration_ticks: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_move_progress( &self, entity_id: Uuid, to: Coordinates, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_end_move( &self, entity_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_entity_stun( &mut self, entity_id: Uuid, duration_ticks: u64, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_entity_cancel_cast_with_cooldown( &mut self, entity_id: Uuid, ability_id: Uuid, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

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>

Source

pub fn handle_entity_incr_attribute( &mut self, entity_id: Uuid, attribute: &str, delta: i64, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_entity_apply_effect( &mut self, entity_id: Uuid, effect_id: Uuid, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

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>

Source

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>

Source

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>

Source

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>

Source

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>

Source

pub fn handle_player_death( &mut self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_entity_death( &mut self, entity_id: Uuid, reward: Vec<CurrencyUnit>, rand_gen: StdRng, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_heal( &self, entity_id: Uuid, heal: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_damage( &self, entity_id: Uuid, damage: u64, current_tick: u64, rand_gen: StdRng, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_fight_progress( &mut self, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

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

Source§

impl OverlordLogic

Source

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.

Source

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).

Source

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.

Source

pub fn handle_event( &mut self, event: &OverlordEvent, state: OverlordState, rand_gen: StdRng, current_tick: u64, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn collect_due_scheduled(&mut self, current_tick: u64) -> Vec<OverlordEvent>

Source

pub fn compute_fields( &self, state: &mut OverlordState, prev_state: &OverlordState, ) -> Vec<OverlordEvent>

Source§

impl OverlordLogic

Source

pub fn new( game_config: SharedGameConfig, behaviors: Arc<BehaviorRegistry>, frontend: bool, ) -> Self

Source

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).

Source

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.

Source

pub fn handle_set_custom_value( &self, key: String, value: i64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_new_character_level( &self, level: i64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_noop( &self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_tutorial_step_completed( &self, step_number: i16, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source§

impl OverlordLogic

Source

pub fn compute_character_level( &self, state: &mut OverlordState, ) -> Vec<OverlordEvent>

Source

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>

Source

pub fn handle_currency_increase( &self, currencies: &[CurrencyUnit], state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_currency_decrease( &self, currencies: &[CurrencyUnit], state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

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.

Source

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.

Source

pub fn handle_show_bird( &mut self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_bird_shown( &mut self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_rate_us_shown( &mut self, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source§

impl OverlordLogic

Source§

impl OverlordLogic

Source§

impl OverlordLogic

Source

pub fn handle_equip_pet( &self, slot_id: u64, pet_id: PetId, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn build_pet_combat_state( &self, state: &OverlordState, ) -> (Option<ActivePetAbility>, Option<PetId>)

Source

pub fn handle_unequip_pet( &self, slot_id: PetSlotId, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_equip_pets( &self, equipped_pets: EquippedPets, current_tick: u64, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source§

impl OverlordLogic

Source§

impl OverlordLogic

Source§

impl OverlordLogic

Source

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

Source

pub fn handle_new_task( &self, new_task: VassalTask, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_give_resist_task( &self, new_task: VassalTask, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_accept_task( &self, task_id: Uuid, is_good: bool, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

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>

Source

pub fn handle_resist_task_accepted( &self, resist_task: VassalTask, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_hit_hands( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_catch_resist_task( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_hands_hitted( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_resist_task_catched( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_finish_task( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_resist_task_finished( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_claim_task_reward( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_claim_resist_task_reward( &self, task_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_new_suzerain( &self, new_suzerain: Option<Suzerain>, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Source

pub fn handle_remove_vassal( &self, vassal_id: Uuid, state: OverlordState, ) -> EventHandleResult<OverlordEvent, OverlordState>

Trait Implementations§

Source§

impl Debug for OverlordLogic

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,