Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
fa3229df
Commit
fa3229df
authored
12 years ago
by
echicken
Browse files
Options
Downloads
Patches
Plain Diff
Initial loan must be repayed at the end of Day 1 of the player's first week.
Rent is collected every four weeks.
parent
f119d42c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
xtrn/thirsty/game.ini
+3
-1
3 additions, 1 deletion
xtrn/thirsty/game.ini
xtrn/thirsty/player.js
+3
-0
3 additions, 0 deletions
xtrn/thirsty/player.js
xtrn/thirsty/thirsty.js
+25
-0
25 additions, 0 deletions
xtrn/thirsty/thirsty.js
with
31 additions
and
1 deletion
xtrn/thirsty/game.ini
+
3
−
1
View file @
fa3229df
...
...
@@ -16,4 +16,6 @@ reportCost = 50
; Cost of a 'unit' of water
waterCost
=
0.05
; Cost of electricity per day
electricityCost
=
4
\ No newline at end of file
electricityCost
=
4
; Cost of rent per four "weeks"
rentCost
=
400
\ No newline at end of file
This diff is collapsed.
Click to expand it.
xtrn/thirsty/player.js
+
3
−
0
View file @
fa3229df
...
...
@@ -10,6 +10,8 @@ var makePlayer = function() {
'
money
'
:
gameSettings
.
startingFunds
,
'
day
'
:
1
,
'
week
'
:
gameSettings
.
week
,
'
weeks
'
:
1
,
'
lastRentPayment
'
:
0
,
'
marketReport
'
:
0
,
'
inventory
'
:
{},
'
products
'
:
{}
...
...
@@ -49,6 +51,7 @@ var getPlayer = function() {
jsonClient
.
push
(
"
THIRSTY
"
,
"
THIRSTY.NEWS
"
,
message
,
2
);
}
else
if
(
player
.
week
!=
gameSettings
.
week
)
{
player
.
week
=
gameSettings
.
week
;
player
.
weeks
++
;
player
.
day
=
1
;
}
else
{
return
player
;
...
...
This diff is collapsed.
Click to expand it.
xtrn/thirsty/thirsty.js
+
25
−
0
View file @
fa3229df
...
...
@@ -66,6 +66,7 @@ var dataInit = function() {
'
reportCost
'
:
parseInt
(
gameIni
.
reportCost
),
'
waterCost
'
:
parseFloat
(
gameIni
.
waterCost
),
'
electricityCost
'
:
parseFloat
(
gameIni
.
electricityCost
),
'
rentCost
'
:
parseFloat
(
gameIni
.
rentCost
),
'
week
'
:
1
};
var
newsItem
=
[{
...
...
@@ -597,6 +598,30 @@ var playTurn = function() {
putNews
(
report
);
jsonClient
.
push
(
"
THIRSTY
"
,
"
THIRSTY.NEWS
"
,
message
,
2
);
if
(
player
.
day
==
1
&&
player
.
weeks
==
1
)
{
player
.
money
=
player
.
money
-
gameSettings
.
startingFunds
;
putNews
(
"
The bank collected on its $
"
+
gameSettings
.
startingFunds
+
"
loan.
"
,
LIGHTRED
);
}
if
(
player
.
weeks
%
4
==
0
)
{
while
(
player
.
lastRentPayment
<
player
.
weeks
)
{
player
.
lastRentPayment
=
player
.
lastRentPayment
+
4
;
player
.
money
=
player
.
money
-
gameSettings
.
rentCost
;
putNews
(
format
(
"
Your landlord collected $%s in rent for month %s.
"
,
gameSettings
.
rentCost
,
player
.
lastRentPayment
),
LIGHTRED
);
if
(
player
.
money
<
0
)
break
;
}
}
player
.
day
++
;
jsonClient
.
write
(
"
THIRSTY
"
,
"
THIRSTY.PLAYERS.
"
+
playerID
,
player
,
2
);
if
(
player
.
money
<=
0
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment