forked from unimatrix/web
Add daily emergency rescue and world-scoped home travel
This commit is contained in:
parent
48a40f0c90
commit
43998712f1
1 changed files with 169 additions and 46 deletions
|
|
@ -20,3 +20,10 @@ export async function currentGuildDiscount(base,house,now=Date.now()){
|
|||
const holder=await officeAuthority(db,{office:'spacing_guild'},{id:row.actor_id},now);if(holder?.termId===row.term_id)discount=Math.max(discount,payload.percent);
|
||||
}return discount;
|
||||
}
|
||||
|
||||
export function standardGuildFare(base,percent,reduction){
|
||||
if(!Number.isSafeInteger(base)||base<1||base>100000000||
|
||||
!Number.isInteger(percent)||percent<0||percent>5||
|
||||
!Number.isInteger(reduction)||reduction<0||reduction>25)return null;
|
||||
return Math.min(100000000,Math.max(1,Math.ceil(base*(100+percent)*(100-reduction)/10000)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff