module hero::example {
use sui::balance::{Self, Balance};
use sui::coin::{Self, Coin};
use sui::event;
use sui::sui::SUI;
/// Player character
public struct Hero has key, store {
id: UID,
game_id: ID,
health: u64,
experience: u64,
sword: Option<Sword>,
}
/// Weapon
public struct Sword has key, store {
id: UID,
game_id: ID,
magic: u64,
strength: u64,
}
/// Consumable item
public struct Potion has key, store {
id: UID,
game_id: ID,
potency: u64,
}
/// Enemy
public struct Boar has key, store {
id: UID,
game_id: ID,
health: u64,
strength: u64,
}
/// Game state
public struct Game has key {
id: UID,
payments: Balance<SUI>,
}
/// Admin capability
public struct Admin has key, store {
id: UID,
game_id: ID,
boars_created: u64,
potions_created: u64,
}
const MAX_HP: u64 = 1000;
const MAX_MAGIC: u64 = 10;
const MIN_SWORD_COST: u64 = 100;
}