Commit 849d7b02 authored by 18손재민's avatar 18손재민 Committed by 18신대성

공격 단어 무게 및 반격시간 관련 이슈 일부 수정

parent cfa46b01
...@@ -77,7 +77,7 @@ class GameRoom ...@@ -77,7 +77,7 @@ class GameRoom
{ {
this.roomId = GameServer.getRoomNumber(); this.roomId = GameServer.getRoomNumber();
this.roomIndex = -1; this.roomIndex = -1;
this.startCount = 4; this.startCount = 2;
this.maxPlayer = 100; this.maxPlayer = 100;
this.nextRank = 100; this.nextRank = 100;
......
class WordObject class WordObject
{ {
constructor(text, isNameWord = false) constructor(text, isNameWord = false)
{ {
this.generationCode = WordSpace.nextWordCode++; this.generationCode = WordSpace.nextWordCode++;
this.wordText = text; this.wordText = text;
this.wordTyping = WordReader.getWordTyping(this.wordText); this.wordTyping = WordReader.getWordTyping(this.wordText);
this.wordGrade = WordReader.getWordGrade(this.wordTyping); this.wordGrade = WordReader.getWordGrade(this.wordTyping);
this.wordWeight = WordReader.getWordWeight(this.wordGrade); this.wordWeight = WordReader.normalWeight[3 - this.wordGrade];
//console.log("wordTyping : " + this.wordTyping + '\n' + "wordGrade : " + this.wordGrade + '\n' + "wordWeight : " + this.wordWeight + '\n'); //console.log("wordTyping : " + this.wordTyping + '\n' + "wordGrade : " + this.wordGrade + '\n' + "wordWeight : " + this.wordWeight + '\n');
this.wordSpeed = 0.5; this.wordSpeed = 0.5;
this.isNameWord = isNameWord; this.isNameWord = isNameWord;
...@@ -141,14 +142,12 @@ class AttackWord extends WordObject ...@@ -141,14 +142,12 @@ class AttackWord extends WordObject
{ {
super(text); super(text);
this.wordGrade = _wordGrade; this.wordGrade = _wordGrade;
this.wordWeight = WordReader.getWordWeight(this.wordGrade); this.wordWeight = this.isStrong ? WordReader.strongAttackWeight[3 - this.wordGrade] : WordReader.attackWeight[3 - this.wordGrade];
if(WordReader.getWordTyping(_playerData.nickname) > 9) if(WordReader.getWordTyping(_playerData.nickname) > 9)
this.wordWeight += this.wordWeight * 0.2 * (WordReader.getWordTyping(_playerData.nickname) - 9); this.wordWeight += this.wordWeight * 0.2 * (WordReader.getWordTyping(_playerData.nickname) - 9);
this.wordWeight *= isStrong ? 3 : 2;
this.attacker = _playerData; this.attacker = _playerData;
/*this.counterTime = WordSpace.gameTimer.now + 1000 * (this.wordTyping <= (5 - _wordGrade) * 2.5 ? this.wordTyping / (Math.max(200, WordSpace.playerTyping) / 60) * 1.5 : this.counterTime = WordSpace.gameTimer.now + 1000 * (this.wordTyping <= (5 - _wordGrade) * 2.5 ? this.wordTyping / (Math.max(200, WordSpace.playerTyping) / 60) * 1.5 :
((5 - _wordGrade) * 3 + (this.wordTyping - (5 - _wordGrade) * 2.5) * 2.5) / (Math.max(200, WordSpace.playerTyping) / 60) * 1.5);*/ ((5 - _wordGrade) * 3 + (this.wordTyping - (5 - _wordGrade) * 2.5) * 2.5) / (Math.max(200, WordSpace.playerTyping) / 60) * 1.5);
this.counterTime = WordSpace.gameTimer.now + 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);
} }
...@@ -194,8 +193,9 @@ class AttackWord extends WordObject ...@@ -194,8 +193,9 @@ class AttackWord extends WordObject
} }
if(WordSpace.gameTimer.now < this.counterTime) if(WordSpace.gameTimer.now < this.counterTime)
{ {
console.log(this.attacker);
let tempWord = WordSpace.generateWord.Name(ScenesData.gameScene, true, this.attacker); let tempWord = WordSpace.generateWord.Name(ScenesData.gameScene, true, this.attacker);
tempWord.physicsObj.setPosition(this.physicsObj.x, this.physicsObj.y);
tempWord.wordObj.setPosition(tempWord.physicsObj.x, tempWord.physicsObj.y);
tempWord.destroy(); tempWord.destroy();
} }
if(this.maskBackground != null) this.maskBackground.destroy(); if(this.maskBackground != null) this.maskBackground.destroy();
......
...@@ -54,9 +54,6 @@ WordReader.getWordGrade = function(_wordTyping) ...@@ -54,9 +54,6 @@ WordReader.getWordGrade = function(_wordTyping)
17 <= _wordTyping && _wordTyping < 26 ? 0 : -1; 17 <= _wordTyping && _wordTyping < 26 ? 0 : -1;
} }
WordReader.getWordWeight = function(_wordGrade) WordReader.normalWeight = [3, 5, 7, 10];
{ WordReader.attackWeight = [6, 8, 12, 15];
return _wordGrade == 3 ? 3 : WordReader.strongAttackWeight = [10, 13, 16, 20];
_wordGrade == 2 ? 5 : \ No newline at end of file
_wordGrade == 1 ? 7 : 10;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment