The game is you hit me, I hit you a bit, both sides have played into the following round, now is the case. On the left is the offensive side, first hit------------left character A, character B, character C------------right enemy apk process is character a----> attack: Enemy a enemy a----> attack: Character A (now the enemy has finished attacking, left no attack finished) Character B----> attack: Enemy a character C----> attack: The enemy a========== here, a round of attacks, even if completed, into the next round of pk===== character initiator (i.e. left) character a----> attack: Enemy a enemy a----> attack: Character A (now the enemy has finished attacking, left no attack) Character B----> attack: Enemy a character C----> attack: Enemy a ... For example, the characters on both sides are made up of arrays. Character $humen = Array (1 = = Array (' name ' = ' + ' character a ' is_attack ' =>0,//indicates whether this round has been attacked, resets him in the new round), 2 = = Array (' name ' = ' character B ', ' Is_attack ' =>0,), 3 = = Array (' name ' = ' + ' character C ', ' I S_attack ' =>0,));//Enemy $enemy= Array (1 = = Array (' name ' = ' enemy a ', ' Is_attack ' =>0,),) ; In the end, this process is formed.
Array (launch = ' left ', Attackor = 1,//character A launches attack hurt = = Array (0 = = Array (' Beattackors ' + 1),//Enemy A is attacked Beattackors array index of the corresponding place), 1 = = Array (launch = ' right ', Attackor =& Gt 1,//Enemy A initiates an attack hurt = = Array (0 = + Array (' beattackors ' + 1),//character A is attacked by the beattackors of the corresponding place)), 2 = = Array (launch = ' left ', Attackor = 2,//character B launches attack hurt = = Array (0 = = Array (' Be Attackors ' + 1),//Enemy A is attacked by the array index of the beattackors corresponding place), and//here as the enemy has been attacked, but the party has not finished attacking, continue to the Left 3 = array ( Launch = ' Left ', Attackor = 3,//character C launches attack hurt = = Array (0 = = Array (' beattackors ' = 1), Attacking an array index of the enemy a beattackors corresponding place));
How does PHP implement this PK process?
Reply content:
The game is you hit me, I hit you a bit, both sides have played into the following round, now is the case. On the left is the offensive side, first hit------------left character A, character B, character C------------right enemy apk process is character a----> attack: Enemy a enemy a----> attack: Character A (now the enemy has finished attacking, left no attack finished) Character B----> attack: Enemy a character C----> attack: The enemy a========== here, a round of attacks, even if completed, into the next round of pk===== character initiator (i.e. left) character a----> attack: Enemy a enemy a----> attack: Character A (now the enemy has finished attacking, left no attack) Character B----> attack: Enemy a character C----> attack: Enemy a ... For example, the characters on both sides are made up of arrays. Character $humen = Array (1 = = Array (' name ' = ' + ' character a ' is_attack ' =>0,//indicates whether this round has been attacked, resets him in the new round), 2 = = Array (' name ' = ' character B ', ' Is_attack ' =>0,), 3 = = Array (' name ' = ' + ' character C ', ' I S_attack ' =>0,));//Enemy $enemy= Array (1 = = Array (' name ' = ' enemy a ', ' Is_attack ' =>0,),) ; In the end, this process is formed.
Array (launch = ' left ', Attackor = 1,//character A launches attack hurt = = Array (0 = = Array (' Beattackors ' + 1),//Enemy A is attacked Beattackors array index of the corresponding place), 1 = = Array (launch = ' right ', Attackor =& Gt 1,//Enemy A initiates an attack hurt = = Array (0 = + Array (' beattackors ' + 1),//character A is attacked by the beattackors of the corresponding place)), 2 = = Array (launch = ' left ', Attackor = 2,//character B launches attack hurt = = Array (0 = = Array (' Be Attackors ' + 1),//Enemy A is attacked by the array index of the beattackors corresponding place), and//here as the enemy has been attacked, but the party has not finished attacking, continue to the Left 3 = array ( Launch = ' Left ', Attackor = 3,//character C launches attack hurt = = Array (0 = = Array (' beattackors ' = 1), Attacking an array index of the enemy a beattackors corresponding place));
How does PHP implement this PK process?
A sequence of attacks is arranged by the speed attribute, the attack is completed, the queue is
Increase the Count attribute in the $humen, record who has attacked, and the character in each item increases the blood bar value attribute and the Is_alive attribute, the blood does not have the is_alive false;