add |bonus womb balance expander

This commit is contained in:
Anton Dyudin 2016-08-11 16:16:05 -07:00 committed by Raymond Pasco
parent f296388df4
commit c0418a80d1
2 changed files with 30 additions and 0 deletions

15
gen/hood/bonus.hoon Normal file
View File

@ -0,0 +1,15 @@
::
:::: /hoon/reinvite/hood/gen
::
/? 310
::
::::
!:
:- %say
|= $: {now/@da eny/@uvI bec/beak}
{{pas/@uvG opt/$@($~ {planets/@u $@($~ {stars/@u $~})})} $~}
==
?~ opt $(opt [planets=1]~)
?~ +.opt $(+.opt [stars=0]~)
:- %womb-bonus
[(scot %uv pas) 1 0]

View File

@ -142,6 +142,7 @@
{$release-ships (list ship)}
{$claim aut/passcode her/@p}
{$recycle who/mail him/knot tik/knot}
{$bonus tid/cord pla/@ud sta/@ud}
{$invite tid/cord ref/reference inv/invite}
{$reinvite aut/passcode inv/invite}
==
@ -604,6 +605,7 @@
+>
?- -.pok.i.a
$claim (teba (poke-claim +.pok.i.a))
$bonus (teba (poke-bonus +.pok.i.a))
$invite (teba (poke-invite +.pok.i.a))
$report (teba (poke-report +.pok.i.a))
$release (teba (poke-release +.pok.i.a))
@ -613,6 +615,19 @@
==
==
::
++ poke-bonus :: expand invitation
|= {tid/cord pla/@ud sta/@ud}
=< abet
=. log-transaction (log-transaction %bonus +<)
?> |(=(our src) =([~ src] boss)) :: priveledged
=/ pas ~|(bad-invite+tid `passcode`(slav %uv tid))
%_ .
bureau
%+ ~(put by bureau) (shaf %pass pas)
=/ bal ~|(%bad-passcode (~(got by bureau) (shaf %pass pas)))
bal(planets (add pla planets.bal), stars (add sta stars.bal))
==
::
++ poke-invite :: create invitation
|= {tid/cord ref/reference inv/invite}
=< abet