nova-character-stats
SP2KZ109PC2HRFH8T37ZD8VAQF2DK38RTXQSBK80TSource Code
;; nova-character-stats.clar
;; Stores RPG stats
;; CLARITY VERSION: 2
(define-map stats
uint ;; token-id
{
level: uint,
strength: uint,
magic: uint
}
)
(define-public (set-stats (id uint) (level uint) (str uint) (mag uint))
(begin
;; Auth check omitted
(map-set stats id {level: level, strength: str, magic: mag})
(ok true)
)
)
(define-read-only (get-stats (id uint))
(map-get? stats id)
)
Functions (2)
| Function | Access | Args |
|---|---|---|
| set-stats | public | id: uint, level: uint, str: uint, mag: uint |
| get-stats | read-only | id: uint |