Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

khunpanya
Copy link

@khunpanya khunpanya commented Sep 27, 2016

Closes issues

Changes

Add Battle Page

  • Basic battle UI and animations.
  • Swap pokemon dialog
  • 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.

@ledevmacedo
Copy link

I liked! It would be a great resource for pogo

@jakubsuchybio
Copy link
Collaborator

jakubsuchybio commented Sep 27, 2016

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.

@tomasek
Copy link

tomasek commented Sep 27, 2016

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

@jakubsuchybio
Copy link
Collaborator

jakubsuchybio commented Sep 27, 2016

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

@ArthurSDev
Copy link

Where are we going to get the Pokecoins?

@WavingLawyer644
Copy link

@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

@Somebody2804
Copy link

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

@ledevmacedo
Copy link

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

@khunpanya
Copy link
Author

@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.

@programmer135
Copy link

programmer135 commented Nov 10, 2016

@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.

@khunpanya khunpanya changed the title Add BattlePage UI with basic animations (no game play) [WIP] Add BattlePage UI with basic animations (no game play) Nov 11, 2016
@khunpanya
Copy link
Author

@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.

@programmer135
Copy link

Yes and I can help fix the code in pull

@programmer135
Copy link

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

@khunpanya
Copy link
Author

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?

@programmer135
Copy link

@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.

@khunpanya
Copy link
Author

khunpanya commented Nov 14, 2016

Uh oh my master branch is messed.

@khunpanya
Copy link
Author

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.

@programmer135
Copy link

Try to fix them check than upload

@programmer135
Copy link

how is it going

@tomasek
Copy link

tomasek commented Nov 21, 2016

@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?

@khunpanya
Copy link
Author

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

@tomasek
Copy link

tomasek commented Nov 21, 2016

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants