[project1dev] Re: Project1 - SVN Update 564

  • From: Alan Wolfe <alan.wolfe@xxxxxxxxx>
  • To: project1dev@xxxxxxxxxxxxx
  • Date: Thu, 14 Jan 2010 21:12:59 -0800

i started playing with the raise code, just movin some stuff around trying
to simplify the math.

I moved the wager increase to the top of the function and then based the
rest of the math on the change in wager (function attached).

I don't really know why it wasn't working before but this looks like
it works so good enough for me lol

On Thu, Jan 14, 2010 at 8:39 PM, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:

> lol just bein silly :P
>
> tracking this bug down, its a tough one!  i thought maybe an extra raise
> button was getting added so like, it was calling the raise function multiple
> times but thats not it.
>
> still tryin to track it down :P
>   On Thu, Jan 14, 2010 at 8:32 PM, Kent Petersen <kentkmp@xxxxxxxxx>wrote:
>
>> That is what I'm talking about. Code 14 error eh?
>>
>>
>> On Thu, Jan 14, 2010 at 8:01 PM, Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:
>>
>>> hrm so i was watching the player gold while hitting raise for each turn.
>>>
>>> the player gold went...
>>>
>>> P1: 95
>>> P2: 90
>>> P3: 85
>>> P4: 80
>>>
>>> P1: 75
>>> P2: 70
>>> P3: 65
>>> P4: 60
>>>
>>> P1: 50  <-- Code 14: error!
>>> P2: 45
>>> (etc)
>>> is that what you are talking about?
>>>
>>> checking it out to see whats up
>>>   On Thu, Jan 14, 2010 at 5:30 PM, Alan Wolfe <alan.wolfe@xxxxxxxxx>wrote:
>>>
>>>> ill check it out and see when i get home but what do you mean by its not
>>>> accurate? (:
>>>>   On Thu, Jan 14, 2010 at 4:12 PM, Apache User <
>>>> dhapache@xxxxxxxxxxxxxxxxxxx> wrote:
>>>>
>>>>> User:korgath
>>>>>
>>>>> Message: updated the voidmap hacking puzzle to use the newer version of
>>>>> the song
>>>>>
>>>>> updated pirate dice:
>>>>> - fixed dice display bug
>>>>> - adjust call and raise to work more like poker
>>>>>
>>>>> BUG HELP!
>>>>> I have a logic bug I can't figure out. If everyone raises a few times
>>>>> in a row around the 8th raise it will no longer be accurate.
>>>>>
>>>>> <Files Changed>
>>>>> U   Audio/Music/TheVoid/HackingPuzzle 01.mp3
>>>>> U   Scripts/Personal/Kent/piratedice.lua
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
----------------------------------------
--PlayerTurn_Raise
----------------------------------------
function PlayerTurn_Raise()

  --TODO: make it so you can't wager a negative

  PlayerChoice[CurrentPlayer]="raise";

  --raises current wager by selected amount
  CurrentWager=CurrentWager+RaiseGoldAmount;

  --find the difference between how much the players put in and the current 
wager
  if PlayerWager[CurrentPlayer]<CurrentWager then
    WagerDifference=CurrentWager-PlayerWager[CurrentPlayer];
  else
    WagerDifference=0;
  end

  CallTotal=1;  --since bet raised only current player has met the wager

  --increase player wager to current wager plus selected amount and difference 
(if any)
  PlayerWager[CurrentPlayer]=CurrentWager;

  --increase pot by the amount the player put in
  TotalAnte=TotalAnte+WagerDifference;

  --remove gold amount from player equal to the amount they raised
  PlayerGold[CurrentPlayer]=PlayerGold[CurrentPlayer]-WagerDifference;


  --display what the player did during thier turn
  UI_Kill(AnouncementText[CurrentPlayer]);
  
AnouncementText[CurrentPlayer]=UI_AddText(540,230+(40*CurrentPlayer),1,1,0,0.75,string.format("Player
 %i raises by %i gold",CurrentPlayer,RaiseGoldAmount));


  PlayerTurn_End();

end

Other related posts: