Any help appreciated.
Here are all the pieces of code:
- Code: Select all
class MMRPGATM extends Computers;
var MMRPGATMWindow termwindow;
Var deusexPlayer Player;
var BankTakeOut Safe;
var DeusExRootWindow root;
var MMRPGCreditCard CredCard;
function Frob(Actor Frobber, Inventory frobWith)
{
local BankTakeOut TakeOut;
local MMRPGCreditCard Card;
Player = DeusExPlayer(Frobber);
foreach AllActors(class'BankTakeOut', TakeOut)
{
If (TakeOut.SafeOwner == Player)
{
Safe = TakeOut;
}
}
foreach AllActors(class'MMRPGCreditCard', Card)
{
If (Card.Owner == Player)
{
CredCard = Card;
}
}
if( Player != None )
{
root = DeusExRootWindow(Player.rootWindow);
if (root != None)
{
termwindow = MMRPGATMWindow(root.InvokeUIScreen(Class'MMRPGATMWindow'));
termwindow.SetATM(Self);
termwindow.SetVault(Safe);
termwindow.SetCard(CredCard);
termwindow.SetCompOwner(Self);
termwindow.ShowFirstScreen();
Super.Frob(Frobber, frobWith);
}
}
}
Function WithDrawTen()
{
Safe.TakeOut10();
}
Function WithDrawFive()
{
Safe.TakeOut5();
}
Function WithDrawOne()
{
Safe.TakeOut1();
}
defaultproperties
{
bInvincible=True
ItemName="CashPoint"
bPushable=False
Physics=PHYS_None
Mesh=LodMesh'DeusExDeco.ATM'
SoundRadius=8
SoundVolume=255
AmbientSound=Sound'DeusExSounds.Generic.ElectronicsHum'
CollisionHeight=40.000000
bCollideWorld=False
Mass=400.000000
Buoyancy=200.000000
BindName="ComputerATM"
}
- Code: Select all
class MMRPGATMScreen extends ComputerUIWindow;
//var int MoneyInBank;
var BankTakeOut Safe;
var MMRPGATM MainATM;
var DeusExPlayer player;
var MMRPGCreditCard CredCard;
var MenuUIActionButtonWindow btnOne;
var MenuUIActionButtonWindow btnFive;
var MenuUIActionButtonWindow btnTen;
var MenuUILabelWindow winWarning;
var MenuUILabelWindow winLoginInfo;
var MenuUISmallLabelWindow winLoginError;
var MenuUIEditWindow editAccount;
var MenuUIEditWindow editPIN;
var TextWindow InBankText;
var TextWindow InHandText;
var ATM atmOwner; // what ATM owns this window?
var localized String ButtonLabelOne;
var localized String ButtonLabelFive;
var localized String ButtonLabelTen;
var localized String AccountLabel;
var localized String PinLabel;
var localized String LoginInfoText;
var localized String WarningText;
var localized String StatusText;
var localized String InvalidLoginMessage;
// ----------------------------------------------------------------------
// InitWindow()
//
// Initialize the Window
// ----------------------------------------------------------------------
event InitWindow()
{
Super.InitWindow();
EnableButtons();
}
// ----------------------------------------------------------------------
// CreateControls()
// ----------------------------------------------------------------------
function CreateControls()
{
Super.CreateControls();
btnOne = winButtonBar.AddButton(ButtonLabelOne, HALIGN_Right);
btnFive = winButtonBar.AddButton(ButtonLabelFive, HALIGN_Right);
btnTen = winButtonBar.AddButton(ButtonLabelTen, HALIGN_Right);
CreateMenuLabel(10, 111, AccountLabel, winClient);
CreateMenuLabel(10, 141, PINLabel, winClient);
InBankText = TextWindow(NewChild(Class'TextWindow'));
InBankText.SetPos(140, 166);
InBankText.SetSize(140, 12);
InBankText.SetTextMargins(0, 0);
InBankText.SetTextAlignments(HALIGN_Center, VALIGN_Center);
InBankText.SetFont(Font'FontMenuSmall_DS');
InBankText.SetTextColorRGB(255, 255, 255);
InHandText = TextWindow(NewChild(Class'TextWindow'));
InHandText.SetPos(140, 199);
InHandText.SetSize(140, 12);
InHandText.SetTextMargins(0, 0);
InHandText.SetTextAlignments(HALIGN_Center, VALIGN_Center);
InHandText.SetFont(Font'FontMenuSmall_DS');
InHandText.SetTextColorRGB(255, 255, 255);
CreateWarningWindow();
CreateLoginInfoWindow();
CreateLoginErrorWindow();
winTitle.SetTitle(Title);
winStatus.SetText(StatusText);
EnableButtons();
CheckBalance();
}
// ----------------------------------------------------------------------
// UpdateStatus()
// ----------------------------------------------------------------------
function UpdateStatus()
{
// Update the title, texture and description
winTitle.SetTitle(Title);
}
// ----------------------------------------------------------------------
// CreateWarningWindow()
// ----------------------------------------------------------------------
function CreateWarningWindow()
{
winWarning = MenuUILabelWindow(winClient.NewChild(Class'MenuUILabelWindow'));
winWarning.SetPos(8, 10);
winWarning.SetSize(273, 50);
winWarning.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winWarning.SetTextMargins(0, 0);
winWarning.SetText(WarningText);
}
// ----------------------------------------------------------------------
// CreateLoginInfoWindow()
// ----------------------------------------------------------------------
function CreateLoginInfoWindow()
{
winLoginInfo = MenuUILabelWindow(winClient.NewChild(Class'MenuUILabelWindow'));
winLoginInfo.SetPos(8, 66);
winLoginInfo.SetSize(273, 31);
winLoginInfo.SetTextAlignments(HALIGN_Center, VALIGN_Center);
winLoginInfo.SetTextMargins(0, 0);
winLoginInfo.SetText(LoginInfoText);
}
function CreateLoginErrorWindow()
{
winLoginError = MenuUISmallLabelWindow(winClient.NewChild(Class'MenuUISmallLabelWindow'));
winLoginError.SetPos(80, 172);
winLoginError.SetSize(287, 25);
winLoginError.SetTextAlignments(HALIGN_Left, VALIGN_Center);
winLoginError.SetTextMargins(0, 0);
}
function SetNetworkTerminal(NetworkTerminal newTerm)
{
Super.SetNetworkTerminal(newTerm);
// If the user already hacked this computer, then set the
// "Hack" button to "Return"
if (winTerm != None)
winTerm.SetHackButtonToReturn();
}
function bool ButtonActivated( Window buttonPressed )
{
local bool bHandled;
bHandled = True;
switch( buttonPressed )
{
case btnOne:
MainATM.WithDrawOne();
EnableButtons();
CheckBalance();
break;
case btnFive:
MainATM.WithDrawFive();
EnableButtons();
CheckBalance();
break;
case btnTen:
MainATM.WithDrawTen();
EnableButtons();
CheckBalance();
break;
}
if (!bHandled)
bHandled = Super.ButtonActivated(buttonPressed);
return bHandled;
}
event bool EditActivated(window edit, bool bModified)
{
return True;
}
event bool TextChanged(window edit, bool bModified)
{
EnableButtons();
CheckBalance();
return False;
}
function SetATM(MMRPGATM newATM)
{
MainATM = newATM;
EnableButtons();
CheckBalance();
}
function SetVault(BankTakeOut newVault)
{
Safe = newVault;
EnableButtons();
CheckBalance();
}
function SetCard(MMRPGCreditCard newCard)
{
CredCard = newCard;
EnableButtons();
CheckBalance();
}
function EnableButtons()
{
if (Safe.CanTakeOut10())
btnTen.EnableWindow(True);
else
btnTen.EnableWindow(False);
if (Safe.CanTakeOut5())
btnFive.EnableWindow(True);
else
btnFive.EnableWindow(False);
if (Safe.CanTakeOut1())
btnOne.EnableWindow(True);
else
btnOne.EnableWindow(False);
}
function CheckBalance()
{
local float MoneyInBank;
local float MoneyInHand;
Safe.CheckBalance();
MoneyInBank = Safe.MoneyInBank;
InBankText.SetText(String(Int(MoneyInBank)) $ " c.");
MoneyInHand = CredCard.CreditAmount;
InHandText.SetText(String(Int(MoneyInHand)) $ " c.");
}
defaultproperties
{
AccountLabel="Money In Vault:"
PinLabel="Money On Card:"
LoginInfoText="Your account balance:"
WarningText="SELECT THE NOTES TO WITHDRAW FROM YOUR BANK VAULT"
StatusText="MMRPG//BANK//TERMINAL:3902.9571[login]"
InvalidLoginMessage="NO MORE MONEY"
ButtonLabelOne="Takeout 1c"
ButtonLabelFive="Takeout 5c"
ButtonLabelTen="Takeout 10c"
Title="MMRPG Banking System"
ClientWidth=303
ClientHeight=231
verticalOffset=30
clientTextures(0)=Texture'DeusExUI.UserInterface.ComputerGBSLogonBackground_1'
clientTextures(1)=Texture'DeusExUI.UserInterface.ComputerGBSLogonBackground_2'
textureRows=1
textureCols=2
bAlwaysCenter=True
statusPosY=206
}
- Code: Select all
class MMRPGATMWindow extends NetworkTerminal;
var BankTakeOut Safe;
var MMRPGATM MainATM;
var MMRPGCreditCard CredCard;
function CloseScreen(String action)
{
Super.CloseScreen(action);
if (action == "LOGOUT")
{
CloseScreen("EXIT");
}
else if (action == "LOGIN")
{
CloseScreen("EXIT");
}
else if (action == "ATMDISABLED")
{
CloseScreen("EXIT");
}
}
function ShowScreen(Class<ComputerUIWindow> newScreen)
{
// First close any existing screen
if (winComputer != None)
{
winComputer.Destroy();
winComputer = None;
}
// Now invoke the new screen
if (newScreen != None)
{
winComputer = ComputerUIWindow(NewChild(newScreen));
winComputer.SetWindowAlignments(HALIGN_Center, VALIGN_Center);
winComputer.SetNetworkTerminal(Self);
winComputer.SetCompOwner(compOwner);
MMRPGATMScreen(WinComputer).SetATM(MainATM);
MMRPGATMScreen(WinComputer).SetVault(Safe);
MMRPGATMScreen(WinComputer).SetCard(CredCard);
MMRPGATMScreen(WinComputer).EnableButtons();
MMRPGATMScreen(WinComputer).CheckBalance();
winComputer.Lower();
}
}
function SetATM(MMRPGATM newATM)
{
MainATM = newATM;
}
function SetVault(BankTakeOut newVault)
{
Safe = newVault;
}
function SetCard(MMRPGCreditCard newcard)
{
CredCard = newCard;
}
defaultproperties
{
bUsesHackWindow=False
FirstScreen=Class'Contender.MMRPGATMScreen'
}
- Code: Select all
class BankTakeOut extends Decoration;
var(Events) name BankName;
var DeusExPlayer SafeOwner;
var MMRPGCreditCard CredCard;
var int MoneyInBank;
Function CheckBalance()
{
local MMRPGCreditsProjectileTen Cred;
local MMRPGCreditsProjectileFive Cred2;
local MMRPGCreditsProjectile Cred3;
local MMRPGCreditCard Card;
MoneyInBank = 0;
foreach VisibleActors(class'MMRPGCreditsProjectileTen', Cred, CollisionRadius)
{
MoneyInBank += 10;
}
foreach VisibleActors(class'MMRPGCreditsProjectileFive', Cred2, CollisionRadius)
{
MoneyInBank += 5;
}
foreach VisibleActors(class'MMRPGCreditsProjectile', Cred3, CollisionRadius)
{
MoneyInBank += 1;
}
}
Function bool CanTakeOut10()
{
local MMRPGCreditsProjectileTen Cred;
local MMRPGCreditCard Card;
Cred = None;
foreach VisibleActors(class'MMRPGCreditsProjectileTen', Cred, CollisionRadius)
{
If(Cred != None)
{
foreach AllActors(class'MMRPGCreditCard', Card)
{
if (Card.Owner == SafeOwner)
{
CredCard = Card;
return true;
}
}
}
}
return false;
}
Function bool CanTakeOut5()
{
local MMRPGCreditsProjectileFive Cred;
local MMRPGCreditCard Card;
Cred = None;
foreach VisibleActors(class'MMRPGCreditsProjectileFive', Cred, CollisionRadius)
{
If(Cred != None)
{
foreach AllActors(class'MMRPGCreditCard', Card)
{
if (Card.Owner == SafeOwner)
{
CredCard = Card;
return true;
}
}
}
}
return false;
}
Function bool CanTakeOut1()
{
local MMRPGCreditsProjectile Cred;
local MMRPGCreditCard Card;
Cred = None;
foreach VisibleActors(class'MMRPGCreditsProjectile', Cred, CollisionRadius)
{
If(Cred != None)
{
foreach AllActors(class'MMRPGCreditCard', Card)
{
if (Card.Owner == SafeOwner)
{
CredCard = Card;
return true;
}
}
}
}
return false;
}
Function TakeOut10()
{
local MMRPGCreditsProjectileTen Cred;
local int CheckInt;
//Thanks to [A]lex for checkint part!
CheckInt = 0;
if (CanTakeOut10())
{
foreach VisibleActors(class'MMRPGCreditsProjectileTen', Cred, CollisionRadius)
{
if(CheckInt == 0)
{
Cred.Destroy();
CredCard.CreditAmount += 10;
CheckInt = 1;
}
}
}
}
Function TakeOut5()
{
local MMRPGCreditsProjectileFive Cred;
local int CheckInt;
//Thanks to [A]lex for checkint part!
CheckInt = 0;
if (CanTakeOut5())
{
foreach VisibleActors(class'MMRPGCreditsProjectileFive', Cred, CollisionRadius)
{
if(CheckInt == 0)
{
Cred.Destroy();
CredCard.CreditAmount += 5;
CheckInt = 1;
}
}
}
}
Function TakeOut1()
{
local MMRPGCreditsProjectile Cred;
local int CheckInt;
//Thanks to [A]lex for checkint part!
CheckInt = 0;
if (CanTakeOut1())
{
foreach VisibleActors(class'MMRPGCreditsProjectile', Cred, CollisionRadius)
{
if(CheckInt == 0)
{
Cred.Destroy();
CredCard.CreditAmount += 1;
CheckInt = 1;
}
}
}
}
defaultproperties
{
bHidden=True
Physics=PHYS_None
DrawType=DT_Sprite
Texture=Texture'Engine.S_Inventory'
DrawScale=1.000000
CollisionRadius=43.000000
CollisionHeight=40.000000
Mass=0.000000
Buoyancy=0.000000
bBlockActors=False
bBlockPlayers=False
bCollideActors=False
bCollideWorld=False
bProjTarget=False
}