Add terrain biomes jumping and extensible gathering professions
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { api, el, type RecordCharacter } from './portal-shared';
|
||||
import { statLabel } from './character-stats';
|
||||
|
||||
type Catalog={items:{id:string;name:string}[];titles:{id:string;name:string}[]};
|
||||
type Catalog={gathering?:{resources:{id:string;name:string;output:string}[];consumables:{id:string;name:string}[]};items:{id:string;name:string}[];titles:{id:string;name:string}[]};
|
||||
export function playerContent(record:RecordCharacter,enabled:boolean,onQueued:()=>void){
|
||||
const root=el('section','','player-content');root.append(el('h3','Manage items and titles'));
|
||||
if(!enabled){root.append(el('p','A living character or survivor with an available world owner is required.','muted'));return root;}
|
||||
@@ -19,11 +19,13 @@ export function playerContent(record:RecordCharacter,enabled:boolean,onQueued:()
|
||||
switch(operation.value){
|
||||
case 'grant-item':
|
||||
for(const i of catalog.items)choice.append(new Option(`${i.name} (${i.id})`,i.id));
|
||||
for(const r of catalog.gathering?.resources??[])if(r.output==='self')choice.append(new Option(r.name,r.id));
|
||||
for(const i of catalog.gathering?.consumables??[])choice.append(new Option(i.name,i.id));
|
||||
for(const id of ['axe','flint_and_steel','fishing_pole','wood','ore','herb','bandage'])choice.append(new Option(statLabel(id),id));
|
||||
notice.textContent='Items go into the bag. Equipment requirements still apply when equipping.';break;
|
||||
case 'remove-item':
|
||||
for(const i of v.items??[]){const slot=Object.entries(v.equipment??{}).find(([,id])=>id===i.id)?.[0];choice.append(new Option(`${i.name}${slot?` [${statLabel(slot)}]`:''} · ${i.id}`,i.id));}
|
||||
for(const [id,n] of Object.entries(v.inventory??{}))if(n>0)choice.append(new Option(`${statLabel(id)} · ${n} held`,id));
|
||||
for(const [id,n] of Object.entries(v.inventory??{}))if(n>0)choice.append(new Option(`${v.stackNames?.[id]??statLabel(id)} · ${n} held`,id));
|
||||
notice.textContent='Removes the selected instance or stack quantity. Equipped items are unequipped automatically.';break;
|
||||
case 'grant-title':
|
||||
for(const t of catalog.titles)choice.append(new Option(`${t.name} (${t.id})`,t.id));
|
||||
|
||||
Reference in New Issue
Block a user