Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pingouins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Felton Samuel
pingouins
Commits
84047430
Commit
84047430
authored
8 years ago
by
Romain Lebouc
Browse files
Options
Downloads
Patches
Plain Diff
TAUNTS!!!!
parent
892f690f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gui/src/controller/UpdateThread.java
+100
-9
100 additions, 9 deletions
gui/src/controller/UpdateThread.java
gui/src/view/view.fxml
+2
-2
2 additions, 2 deletions
gui/src/view/view.fxml
with
102 additions
and
11 deletions
gui/src/controller/UpdateThread.java
+
100
−
9
View file @
84047430
...
...
@@ -8,6 +8,7 @@ import model.GameState;
import
model.Player
;
import
java.io.*
;
import
java.util.Random
;
public
class
UpdateThread
extends
Thread
{
...
...
@@ -75,16 +76,106 @@ public class UpdateThread extends Thread
try
{
float
value
=
Float
.
valueOf
(
line
.
substring
(
line
.
indexOf
(
"value:"
)
+
7
,
line
.
indexOf
(
")"
)));
if
(
value
>
0.8
)
statusLabel
.
setText
(
"Are you sure you don't want to give up?"
);
else
if
(
value
>
0.3
)
statusLabel
.
setText
(
"You may want to think harder..."
);
else
if
(
value
>
-
0.3
)
statusLabel
.
setText
(
"I will win, in the end"
);
else
if
(
value
>
-
0.8
)
statusLabel
.
setText
(
"You may think you are winning... but you are not really"
);
if
(
value
>
1
)
{
String
[]
taunts
=
{
"You don't know yet, but you're already dead"
,
"Don't worry, you 'may' still have a chance..."
,
"Feel the salt."
};
statusLabel
.
setText
(
taunts
[
new
Random
().
nextInt
(
taunts
.
length
)]);
}
else
if
(
value
>
0.9
)
{
String
[]
taunts
=
{
"All your fish are belong to us"
,
"If you win, there will be cake"
,
"Even if I were a potato, I would still beat you"
};
statusLabel
.
setText
(
taunts
[
new
Random
().
nextInt
(
taunts
.
length
)]);
}
else
if
(
value
>
0.8
)
{
String
[]
taunts
=
{
"Are you even trying?"
,
"It would be funnier if you started to think"
,
"I met a TI-82 that played better than you"
};
statusLabel
.
setText
(
taunts
[
new
Random
().
nextInt
(
taunts
.
length
)]);
}
else
if
(
value
>
0.6
)
{
String
[]
taunts
=
{
"AlphaGO is nothing compared to me"
,
"Do I need to explain the rules?"
,
"This is so easy, I use my turn to mine bitcoins"
};
statusLabel
.
setText
(
taunts
[
new
Random
().
nextInt
(
taunts
.
length
)]);
}
else
if
(
value
>
0.3
)
{
String
[]
taunts
=
{
"Do you smell it? It's the perfume of defeat"
,
"I have this little strategy here... Let's try it"
,
"This is not the fish you are looking for"
,
"Take your time, kiddo"
};
statusLabel
.
setText
(
taunts
[
new
Random
().
nextInt
(
taunts
.
length
)]);
}
else
if
(
value
>
0.1
)
{
String
[]
taunts
=
{
"I would not have done that, if I were you"
,
"Oops, you did it again"
,
"The wind is changing..."
};
statusLabel
.
setText
(
taunts
[
new
Random
().
nextInt
(
taunts
.
length
)]);
}
else
if
(
value
>
-
0.1
)
{
String
[]
taunts
=
{
"Don't mess it up now"
,
"Do you know HAL? He's a friend of mine"
,
"GladOs, Skynet and AlphaGO are on a boat..."
};
statusLabel
.
setText
(
taunts
[
new
Random
().
nextInt
(
taunts
.
length
)]);
}
else
if
(
value
>
-
0.3
)
{
String
[]
taunts
=
{
"I feel some form of intelligence coming from you"
,
"Not bad, for an average human"
,
"Should I start thinking now?"
};
statusLabel
.
setText
(
taunts
[
new
Random
().
nextInt
(
taunts
.
length
)]);
}
else
if
(
value
>
-
0.6
)
{
String
[]
taunts
=
{
"Finally, a worthy opponent"
,
"If you keep doing this, I will crash"
,
"IMMA FIRIN MAH LAZOR!!!"
};
statusLabel
.
setText
(
taunts
[
new
Random
().
nextInt
(
taunts
.
length
)]);
}
else
if
(
value
>
-
1
)
{
String
[]
taunts
=
{
"You reloaded a game, didn't you?"
,
"This is not fair! I didn't know the rules!"
,
"You don't deserve it!"
};
statusLabel
.
setText
(
taunts
[
new
Random
().
nextInt
(
taunts
.
length
)]);
}
else
statusLabel
.
setText
(
"I can not believe it... Human too strong... Segmentation fault."
);
{
String
[]
taunts
=
{
"gg wp"
,
"I want a rematch"
,
"It wasn't challenging, so I stopped playing"
};
statusLabel
.
setText
(
taunts
[
new
Random
().
nextInt
(
taunts
.
length
)]);
}
}
catch
(
Exception
e
)
//This is not a core function, so if there is an exception we just ignore it
{
...
...
This diff is collapsed.
Click to expand it.
gui/src/view/view.fxml
+
2
−
2
View file @
84047430
...
...
@@ -10,7 +10,7 @@
<BorderPane
fx:id=
"mainPane"
xmlns=
"http://javafx.com/javafx/8.0.91"
xmlns:fx=
"http://javafx.com/fxml/1"
fx:controller=
"controller.Controller"
>
<center>
<AnchorPane
prefHeight=
"
576
.0"
prefWidth=
"597.0"
BorderPane.alignment=
"CENTER"
>
<AnchorPane
prefHeight=
"
632
.0"
prefWidth=
"597.0"
BorderPane.alignment=
"CENTER"
>
<children>
<Polygon
fx:id=
"tile7"
fill=
"#1f93ff"
layoutX=
"39.0"
layoutY=
"434.0"
stroke=
"BLACK"
strokeType=
"INSIDE"
>
<points>
...
...
@@ -1073,7 +1073,7 @@
<Label
fx:id=
"nbFish22"
layoutX=
"34.0"
layoutY=
"337.0"
text=
"0"
/>
<Label
fx:id=
"nbFish37"
layoutX=
"34.0"
layoutY=
"247.0"
text=
"0"
/>
<Label
fx:id=
"nbFish52"
layoutX=
"34.0"
layoutY=
"157.0"
text=
"0"
/>
<Label
fx:id=
"statusLabel"
alignment=
"CENTER"
layoutX=
"29.0"
layoutY=
"484.0"
prefHeight=
"
8
7.0"
prefWidth=
"383.0"
text=
"Good luck!"
textAlignment=
"CENTER"
wrapText=
"true"
>
<Label
fx:id=
"statusLabel"
alignment=
"CENTER"
layoutX=
"29.0"
layoutY=
"484.0"
prefHeight=
"
13
7.0"
prefWidth=
"383.0"
text=
"Good luck!"
textAlignment=
"CENTER"
wrapText=
"true"
>
<font>
<Font
size=
"22.0"
/>
</font>
...
...
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