Referencia
Esta página se muestra en inglés.
achievements
Achievements a server defines and players unlock; Play Strawberry shows them on the profile and the server page.
Declarations from the script contract strawberry:plugin, version 0.2.0, without source comments.
WIT declarations
use player.{player};
use event.{extension-event};
record text { locale: string, name: string, description: string }
variant icon { shape(string), item(string) }
record definition {
key: string,
texts: list<text>,
icon: option<icon>,
hidden: bool,
progress-max: option<u32>,
order: u16,
points: u16,
}
enum status {
queued,
already-unlocked,
unverified,
no-account,
unknown-achievement,
retired,
unavailable,
}
record achievement-state {
key: string,
unlocked-at: option<u64>,
progress: u32,
}
declare: func(definitions: list<definition>) -> result<_, string>;
unlock: func(player: borrow<player>, key: string) -> status;
set-progress: func(player: borrow<player>, key: string, value: u32) -> status;
get: func(player: borrow<player>, key: string) -> option<achievement-state>;
%list: func(player: borrow<player>) -> option<list<achievement-state>>;
unlocked: func(event: borrow<extension-event>) -> option<string>;