Initial Commit
Initial Commit
This commit is contained in:
62
_module/nss/mpoker_raisebet.nss
Normal file
62
_module/nss/mpoker_raisebet.nss
Normal file
@@ -0,0 +1,62 @@
|
||||
#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") == 2)
|
||||
{
|
||||
//Get the starting PC
|
||||
int nStarter = GetLocalInt(OBJECT_SELF, "STARTER");
|
||||
object oPlayer = GetLocalObject(OBJECT_SELF, "oP"+IntToString(nStarter));
|
||||
SetLocalString(OBJECT_SELF, "CURRENT", "oP"+IntToString(nStarter));
|
||||
|
||||
//Set token
|
||||
SetCustomToken(916, GetName(oPlayer));
|
||||
|
||||
//Retrieve PC's message
|
||||
string sMessage = GetLocalString(OBJECT_SELF, "SPOKEN");
|
||||
if (sMessage == "#yes")
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF, "STAGE", 3);
|
||||
int nBet = GetLocalInt(OBJECT_SELF, "BET");
|
||||
SetLocalInt(OBJECT_SELF, "POT", 2*nBet);
|
||||
TakeGoldFromCreature(nBet, oP1, TRUE);
|
||||
TakeGoldFromCreature(nBet, oP2, TRUE);
|
||||
|
||||
//Deal cards to players hands.
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER1_CARD_1", Deal());
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER2_CARD_1", Deal());
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER1_CARD_2", Deal());
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER2_CARD_2", Deal());
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER1_CARD_3", Deal());
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER2_CARD_3", Deal());
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER1_CARD_4", Deal());
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER2_CARD_4", Deal());
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER1_CARD_5", Deal());
|
||||
SetLocalInt(OBJECT_SELF, "PLAYER2_CARD_5", Deal());
|
||||
|
||||
//Show hands
|
||||
SendMessageToPC(oPlayer, "The pot is: " + IntToString(GetLocalInt(OBJECT_SELF, "POT")));
|
||||
SendMessageToPC(oPlayer, ShowMHandAndScores("PLAYER1"));
|
||||
|
||||
if (nStarter == 1) oPlayer = GetLocalObject(OBJECT_SELF, "oP2");
|
||||
else oPlayer = GetLocalObject(OBJECT_SELF, "oP1");
|
||||
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