PoGo-UWP icon indicating copy to clipboard operation
PoGo-UWP copied to clipboard

[WIP] Add BattlePage UI with basic animations (no game play)

Open khunpanya opened this issue 8 years ago • 22 comments

Closes issues

  • Closes #1669

Changes

Add Battle Page

  • [x] Basic battle UI and animations.
  • [ ] Swap pokemon dialog
  • [x] Battle conclusion dialog

Add UIHelper, and refactor some UI related code to utilize following functions

  • ColorFromString
  • IsDaySky

Change details

I don't know how the battling will be implemented; so I just prepared basic UI and some (crappy) animations for future use. Below are sample "scripted" animations, not a real game play. battle cap2

Other informations

  • View model's binding vars are to be rewritten.

khunpanya avatar Sep 27 '16 19:09 khunpanya

I liked! It would be a great resource for pogo

ledevmacedo avatar Sep 27 '16 20:09 ledevmacedo

Awesome work! I was already gathering information how will I implement it. In the API the fight works like this:

  1. You start the fight with
public static async Task<StartGymBattleResponse> StartGymBattle(string gymid, ulong defendingPokemonId, IEnumerable<ulong> attackingPokemonIds)

Then the fight with this PR animations and UI begins. You fight you aquire skill points for secondary attack on every attack. With your attacks you decrease enemy pokemon HP. This all is done localy and is stored. 2. Every second this stored information is sent to the server via

public static async Task<AttackGymResponse> AttackGym(string gymid, string battleId, List<POGOProtos.Data.Battle.BattleAction> battleActions, POGOProtos.Data.Battle.BattleAction lastRetrievedAction)

function where you send gymid, battleid, list of battleactions and lastretrievedaction. And in response there is calculated actual HP of both pokemon and actual skill points of attacking pokemon (I guess) When servers responds that some pokemon died. The fight continues.

What I don't know right now is:

  • Is secondary attack sent in the stored list of actions? Or is it sent differently alone?
  • How do I get information about enemy attacks? Will I get enemy attacks in some action list for the next second until new action list is retrieved after sending stored actions from me?

Also I haven't looked into the responses yet. But with this PR and your help we could get this working I think :). If the whole API we have supports all aspects of the fighting.

jakubsuchybio avatar Sep 27 '16 20:09 jakubsuchybio

@jakubsuchybio that coding you showed there Works just for the battles between different teams or is it to the training too?

tomasek avatar Sep 27 '16 21:09 tomasek

I think both battles are the same. Only input button is different and output is different (gym prestige++)

jakubsuchybio avatar Sep 27 '16 22:09 jakubsuchybio

Where are we going to get the Pokecoins?

ArthurSDev avatar Sep 29 '16 23:09 ArthurSDev

@ArthurSDev the pokecoins for PoGo so they are coming in later update for pogo no release date yet for new update yet and they are pretty much trying to find a new API Read Why #1725

WavingLawyer644 avatar Sep 30 '16 02:09 WavingLawyer644

How is the API work going @jakubsuchybio ? I love this by the way @khunpanya seriously well done!

Somebody2804 avatar Sep 30 '16 18:09 Somebody2804

@khunpanya The API already fixed, you want to continue with this work?

ledevmacedo avatar Nov 07 '16 18:11 ledevmacedo

@BrazilianBug Yeah, already aware of that. But currently I only know how to make animation. For the game play mechanism, I hope someone would come in and pick these animations up. I'm trying to learn about Touch Manipulation though and hopefully could ready up some Tap, Hold and Swipe events.

khunpanya avatar Nov 07 '16 19:11 khunpanya

@khunpanya i have found a issue in ALL OF THE CODE you have script like todo example:

// TODO Binding vars just for demonstration, need to be rewritten replace the TODO with something like NTD becuase codeclimate can detect this and show it as a failed if that dies not work try to fix that before uploading it.

programmer135 avatar Nov 10 '16 20:11 programmer135

@programmer135 Uh... I write it TODO because it really is. The code need attention, a drastic change is expected but it's not a bug. As long as the whole code compiled, would be just fine. Whether to accept it, the devs will decide.

khunpanya avatar Nov 11 '16 02:11 khunpanya

Yes and I can help fix the code in pull

programmer135 avatar Nov 11 '16 07:11 programmer135

Is not hard the code fixing and binding should be easy just look at other sections of the code of pogo and look for them

programmer135 avatar Nov 11 '16 15:11 programmer135

Good. I currently focus on making the UI. Have no time to see which objects to bind. At first I think I will leave this essential part to the main devs. But if you have time to do it, you can send a PR by and have the main devs review. But shouldn't you make a PR upon my fork than ST-Apps:master?

khunpanya avatar Nov 11 '16 16:11 khunpanya

@khunpanya visual studio is not working so i cant do any editing till i get it fixed is a error in the designer but i will get it fixed is a minor error aand i can get it fixed well try.

programmer135 avatar Nov 11 '16 20:11 programmer135

Uh oh my master branch is messed.

khunpanya avatar Nov 14 '16 21:11 khunpanya

I just know that I should make changes in another branch and leave master branch update with the main repo. Now can anyone tell me how can I reset/clean master branch to keep it update with main repo again? Sorry for messed up here.

khunpanya avatar Nov 14 '16 22:11 khunpanya

Try to fix them check than upload

programmer135 avatar Nov 16 '16 22:11 programmer135

how is it going

programmer135 avatar Nov 20 '16 22:11 programmer135

@khunpanya @jakubsuchybio i am working on the code to start the fights, but, for some reason, when i use the GameClient.StartGymBattle() method the answer is always "unset". Do you have any idea why?

tomasek avatar Nov 21 '16 03:11 tomasek

Haven't test battle api yet. But be careful they are forcing update api 0.47 now.

khunpanya avatar Nov 21 '16 05:11 khunpanya

@ST-Apps is there any difference in the api related to gym support?

tomasek avatar Nov 21 '16 11:11 tomasek