Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sejong25
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Tear of Sejong
sejong25
Commits
682e7530
Commit
682e7530
authored
Jul 09, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
반격 시간 안에 반격하면 공격자의 강호패가 생성됨, 오타 최소치 수정함
parent
8f50f148
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
7 additions
and
6 deletions
+7
-6
GameServer.js
GameServer.js
+1
-1
WordObject.js
js/WordObject.js
+0
-2
WordSpace.js
js/WordSpace.js
+5
-2
main.js
js/main.js
+1
-1
No files found.
GameServer.js
View file @
682e7530
var
GameServer
=
GameServer
||
{};
var
GameServer
=
GameServer
||
{};
GameServer
.
Phase
=
{
READY
:
0
,
START
:
1
,
MAIN
:
2
,
MUSIC
:
3
};
GameServer
.
Phase
=
{
READY
:
0
,
START
:
1
,
MAIN
:
2
,
MUSIC
:
3
};
GameServer
.
startCount
=
2
;
GameServer
.
startCount
=
3
;
GameServer
.
currentPlayer
=
[];
GameServer
.
currentPlayer
=
[];
GameServer
.
playingRoom
=
[];
GameServer
.
playingRoom
=
[];
...
...
js/WordObject.js
View file @
682e7530
...
@@ -117,7 +117,6 @@ class AttackWord extends WordObject
...
@@ -117,7 +117,6 @@ class AttackWord extends WordObject
constructor
(
text
,
_wordGrade
,
_playerData
,
isStrong
)
constructor
(
text
,
_wordGrade
,
_playerData
,
isStrong
)
{
{
super
(
text
);
super
(
text
);
console
.
log
(
_playerData
);
this
.
wordGrade
=
_wordGrade
;
this
.
wordGrade
=
_wordGrade
;
this
.
wordWeight
=
WordReader
.
getWordWeight
(
this
.
wordGrade
);
this
.
wordWeight
=
WordReader
.
getWordWeight
(
this
.
wordGrade
);
if
(
WordReader
.
getWordTyping
(
_playerData
.
nickname
)
<=
9
)
if
(
WordReader
.
getWordTyping
(
_playerData
.
nickname
)
<=
9
)
...
@@ -127,7 +126,6 @@ class AttackWord extends WordObject
...
@@ -127,7 +126,6 @@ class AttackWord extends WordObject
//서버 사용하게 되면 PlayerTyping을 피격자의 것으로 바꿔야 함
//서버 사용하게 되면 PlayerTyping을 피격자의 것으로 바꿔야 함
this
.
counterTime
=
WordSpace
.
gameTimer
.
now
+
1000
*
(
this
.
wordTyping
<=
(
5
-
_wordGrade
)
*
2.5
?
this
.
wordTyping
*
(
WordSpace
.
playerTyping
/
60
)
*
2
:
this
.
counterTime
=
WordSpace
.
gameTimer
.
now
+
1000
*
(
this
.
wordTyping
<=
(
5
-
_wordGrade
)
*
2.5
?
this
.
wordTyping
*
(
WordSpace
.
playerTyping
/
60
)
*
2
:
((
5
-
_wordGrade
)
*
2.5
+
(
this
.
wordTyping
-
(
5
-
_wordGrade
)
*
2.5
)
*
3
)
*
(
WordSpace
.
playerTyping
/
60
)
*
2
);
((
5
-
_wordGrade
)
*
2.5
+
(
this
.
wordTyping
-
(
5
-
_wordGrade
)
*
2.5
)
*
3
)
*
(
WordSpace
.
playerTyping
/
60
)
*
2
);
this
.
counterTime
=
10000
;
console
.
log
(
'
Attack text :
'
+
text
+
'
, Attacker :
'
+
this
.
attacker
.
nickname
+
'
, Weight :
'
+
this
.
wordWeight
);
console
.
log
(
'
Attack text :
'
+
text
+
'
, Attacker :
'
+
this
.
attacker
.
nickname
+
'
, Weight :
'
+
this
.
wordWeight
);
console
.
log
(
'
Counter time :
'
+
this
.
counterTime
);
console
.
log
(
'
Counter time :
'
+
this
.
counterTime
);
}
}
...
...
js/WordSpace.js
View file @
682e7530
...
@@ -253,6 +253,7 @@ WordSpace.generateWord =
...
@@ -253,6 +253,7 @@ WordSpace.generateWord =
Name
:
function
(
scene
,
isStrong
,
lenRate
)
Name
:
function
(
scene
,
isStrong
,
lenRate
)
{
{
word
=
new
NameWord
(
WordSpace
.
nameQueue
.
pop
(),
isStrong
);
word
=
new
NameWord
(
WordSpace
.
nameQueue
.
pop
(),
isStrong
);
//word = new NameWord(RoomData.myself, false);
WordSpace
.
pushWord
(
scene
,
word
,
lenRate
);
WordSpace
.
pushWord
(
scene
,
word
,
lenRate
);
}
}
}
}
...
@@ -334,7 +335,7 @@ WordSpace.findWord = function(wordText)
...
@@ -334,7 +335,7 @@ WordSpace.findWord = function(wordText)
}
}
else
// 오타 체크
else
// 오타 체크
{
{
let
minDist
=
5
,
tempDist
=
0
;
let
minDist
=
WordReader
.
getWordTyping
(
wordText
)
/
2
+
1
,
tempDist
=
0
;
let
attackWords
=
[];
let
attackWords
=
[];
WordSpace
.
wordGroup
.
forEach
(
function
(
element
)
WordSpace
.
wordGroup
.
forEach
(
function
(
element
)
{
{
...
@@ -350,9 +351,10 @@ WordSpace.findWord = function(wordText)
...
@@ -350,9 +351,10 @@ WordSpace.findWord = function(wordText)
if
(
WordSpace
.
getEditDistance
(
wordText
,
element
.
wordText
)
==
minDist
)
if
(
WordSpace
.
getEditDistance
(
wordText
,
element
.
wordText
)
==
minDist
)
{
{
//강호패 보내야 함
//강호패 보내야 함
console
.
log
(
'
Attack word of
'
+
element
.
attacker
.
nickname
+
'
오타임
'
);
console
.
log
(
'
Attack word
:
'
+
element
.
wordText
+
'
of
'
+
element
.
attacker
.
nickname
+
'
오타임
'
);
}
}
});
});
this
.
attackGauge
.
sub
(
2
);
}
}
}
}
...
@@ -393,6 +395,7 @@ WordSpace.attack = function(wordText, grade)
...
@@ -393,6 +395,7 @@ WordSpace.attack = function(wordText, grade)
}
}
socket
.
emit
(
'
attack
'
,
attackData
);
socket
.
emit
(
'
attack
'
,
attackData
);
});
});
//테스트용, 자기 자신에게 공격함
//WordSpace.generateWord.Attack(WordSpace.gameSceneForTest, wordText, grade, PlayerData, false);
//WordSpace.generateWord.Attack(WordSpace.gameSceneForTest, wordText, grade, PlayerData, false);
WordSpace
.
nameGroup
=
[];
WordSpace
.
nameGroup
=
[];
WordSpace
.
attackGauge
.
resetValue
();
WordSpace
.
attackGauge
.
resetValue
();
...
...
js/main.js
View file @
682e7530
...
@@ -24,7 +24,7 @@ PlayerData.nickname = '홍길동'; //플레이어 닉네임
...
@@ -24,7 +24,7 @@ PlayerData.nickname = '홍길동'; //플레이어 닉네임
// 현재 들어가있는 Game Room의 정보
// 현재 들어가있는 Game Room의 정보
var
RoomData
=
RoomData
||
{};
var
RoomData
=
RoomData
||
{};
RoomData
.
myself
=
null
;
RoomData
.
roomNum
=
-
1
;
RoomData
.
roomNum
=
-
1
;
RoomData
.
myself
=
null
;
RoomData
.
players
=
null
;
RoomData
.
players
=
null
;
RoomData
.
aliveCount
=
-
1
;
RoomData
.
aliveCount
=
-
1
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment