-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add upgradeCharacter handler, edit comments
- Loading branch information
Showing
8 changed files
with
127 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package consts | ||
|
||
const ( | ||
CharacterUpgradeIncrease = 5500 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package enums | ||
|
||
const ( | ||
UpgradeAbilityInvincble = iota + 120000 | ||
UpgradeAbilityMagnet = iota + 120001 | ||
UpgradeAbilityTrampoline | ||
UpgradeAbilityCombo | ||
UpgradeAbilityLaser | ||
UpgradeAbilityDrill | ||
UpgradeAbilityAsteroid | ||
UpgradeAbilityRingBonus | ||
UpgradeAbilityDistanceBonus | ||
UpgradeAbilityAnimalBonus | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
package requests | ||
|
||
type ChangeCharacterRequest struct { | ||
Base | ||
MainCharaID string `json:"mainCharacterId"` | ||
SubCharaID string `json:"subCharacterId"` | ||
Base | ||
MainCharaID string `json:"mainCharacterId"` | ||
SubCharaID string `json:"subCharacterId"` | ||
} | ||
|
||
type UpgradeCharacterRequest struct { | ||
Base | ||
AbilityID string `json:"abilityId"` | ||
CharacterID string `json:"characterId"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,44 @@ | ||
package responses | ||
|
||
import ( | ||
"github.com/fluofoxxo/outrun/netobj" | ||
"github.com/fluofoxxo/outrun/responses/responseobjs" | ||
"github.com/fluofoxxo/outrun/netobj" | ||
"github.com/fluofoxxo/outrun/responses/responseobjs" | ||
) | ||
|
||
type ChangeCharacterResponse struct { | ||
BaseResponse | ||
PlayerState netobj.PlayerState `json:"playerState"` | ||
BaseResponse | ||
PlayerState netobj.PlayerState `json:"playerState"` | ||
} | ||
|
||
func ChangeCharacter(base responseobjs.BaseInfo, playerState netobj.PlayerState) ChangeCharacterResponse { | ||
baseResponse := NewBaseResponse(base) | ||
return ChangeCharacterResponse{ | ||
baseResponse, | ||
playerState, | ||
} | ||
baseResponse := NewBaseResponse(base) | ||
return ChangeCharacterResponse{ | ||
baseResponse, | ||
playerState, | ||
} | ||
} | ||
|
||
type UpgradeCharacterResponse struct { | ||
BaseResponse | ||
PlayerState netobj.PlayerState `json:"playerState"` | ||
CharacterState []netobj.Character `json:"characterState"` | ||
} | ||
|
||
func UpgradeCharacter(base responseobjs.BaseInfo, playerState netobj.PlayerState, characterState []netobj.Character) UpgradeCharacterResponse { | ||
baseResponse := NewBaseResponse(base) | ||
return UpgradeCharacterResponse{ | ||
baseResponse, | ||
playerState, | ||
characterState, | ||
} | ||
} | ||
|
||
func DefaultUpgradeCharacter(base responseobjs.BaseInfo, player netobj.Player) UpgradeCharacterResponse { | ||
playerState := player.PlayerState | ||
characterState := player.CharacterState | ||
return UpgradeCharacter( | ||
base, | ||
playerState, | ||
characterState, | ||
) | ||
} |