Initial Commit
Initial Commit
This commit is contained in:
71
_module/nss/mpoker_raisebet2.nss
Normal file
71
_module/nss/mpoker_raisebet2.nss
Normal file
@@ -0,0 +1,71 @@
|
||||
#include "x4_inc_functions"
|
||||
#include "mpoker_include"
|
||||
int StartingConditional()
|
||||
{
|
||||
object oStool1 = GetNearestObjectByTag("mpoker_stool1");
|
||||
object oStool2 = GetNearestObjectByTag("mpoker_stool2");
|
||||
|
||||
object oP1 = GetSittingCreature(oStool1);
|
||||
object oP2 = GetSittingCreature(oStool2);
|
||||
|
||||
SetLocalObject(OBJECT_SELF, "oP1", oP1);
|
||||
SetLocalObject(OBJECT_SELF, "oP2", oP2);
|
||||
|
||||
if (GetLocalInt(OBJECT_SELF, "STAGE") == 4)
|
||||
{
|
||||
//Retrieve PC's message
|
||||
string sMessage = GetLocalString(OBJECT_SELF, "SPOKEN");
|
||||
if (sMessage == "#done")
|
||||
{
|
||||
//Discard player cards
|
||||
int iCount;
|
||||
for(iCount = 1; iCount <= 5; iCount++) { //Interate through the 5 cards in the hand.
|
||||
if(GetLocalInt(OBJECT_SELF, "PLAYER1_DISCARD_" + IntToString(iCount)) > 0) //If discard is NOT 0...
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER1_CARD_" + IntToString(iCount), Deal()); //..Deal a NEW card in this spot.
|
||||
}
|
||||
}
|
||||
|
||||
//Resetting variables used for tracking discarded cards.
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER1_DISCARD_1", 0);
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER1_DISCARD_2", 0);
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER1_DISCARD_3", 0);
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER1_DISCARD_4", 0);
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER1_DISCARD_5", 0);
|
||||
|
||||
//Show hands
|
||||
string sCurrent = GetLocalString(OBJECT_SELF, "CURRENT");
|
||||
object oPlayer = GetLocalObject(OBJECT_SELF, sCurrent);
|
||||
SendMessageToPC(oPlayer, "The pot is: " + IntToString(GetLocalInt(OBJECT_SELF, "POT")));
|
||||
SendMessageToPC(oPlayer, ShowMHandAndScores("PLAYER1"));
|
||||
|
||||
//Get next player
|
||||
if (sCurrent == "oP1")
|
||||
{
|
||||
oPlayer = GetLocalObject(OBJECT_SELF, "oP2");
|
||||
SetLocalString(OBJECT_SELF, "CURRENT", "oP2");
|
||||
}
|
||||
else
|
||||
{
|
||||
oPlayer = GetLocalObject(OBJECT_SELF, "oP1");
|
||||
SetLocalString(OBJECT_SELF, "CURRENT", "oP1");
|
||||
}
|
||||
|
||||
//Next stage
|
||||
SetLocalInt(OBJECT_SELF, "STAGE", 5);
|
||||
|
||||
//Set token
|
||||
SetCustomToken(916, GetName(oPlayer));
|
||||
|
||||
//Show hands
|
||||
SendMessageToPC(oPlayer, "The pot is: " + IntToString(GetLocalInt(OBJECT_SELF, "POT")));
|
||||
SendMessageToPC(oPlayer, ShowMHandAndScores("PLAYER2"));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
Reference in New Issue
Block a user