DIGIMON Wars: Battle of the JAVA Monsters
For Submission of 10 digimons:
- JAVA File
- All Digimon Classes should be under package:
- ph.softartifact.digiwars.data.model.<school>
- Kindly submit only the 10 Digimon JAVA Files. XXX.java. (not the .class)
- No additional JAVA files will be accepted.
- External classes will not be allowed. Declare them as inner classes.
- Your 10 Digimon JAVA files should have NO dependency to other classes. Every Digimon class should stand on its own.
- Submission Packaging
- Put into RAR file with RAR name: <SCHOOL>.rar
- Email Submission
- Email to: [email protected]
- Subject: DIGIWARS:<SCHOOL>
- Date of Submission should be before: July 12, 2013 8pm. (Adjusted from 5pm)
- USB Submission
- USBs containing the Digimons will be collected on July 13, 2013 11am, to override the Digimons submitted online on July 12, 2013 8pm
You can download the project here.
Date Updated: July 10, 2013 (July 12, 2013 will not be used, we revert back to July 10, 2013)
https://docs.google.com/file/d/0BwoTHWconhEPc0pJOUkyVmZVNk0/edit
Take note of the last update date.
Changes:
-
The timer is officially set to 60 seconds. Since this is a round robin, and there are 4 official contestants, 4!/2 = 12 combinations. with 1 minute each and max of 5 fights each, we’ll have 36 min to 1 hour duration.
Rules Changes:
- The team who will cause the System to Loop Infinitely will lose the fight.
- The fight ends either when Fight Timer Ends or when the opponents’ Team Life is depleted to 0.
- Regeneration
- For Active Digimon: Before every turn, MP regenerates by 1
- For Inactive Digimon: Before every turn, MP regenerates by 2 and HP by 1.
—————————-
This year, SPEED-IT will be hosting its first ever DIGIMON Wars, which will showcase Programming skills of participating schools in terms of JAVA Coding, and Turn-Based Strategy Making.
To allow even the member schools to participate in this category, all codes are developed by Soft Artifact, Incorporated, and it abides by the non-disclosure agreement established between Soft Artifact and SPEED-IT.
Event Overview (Updated July 12, 2013)
- Every school will send off two participants.
- These participants will develop ten (10) Digimon Classes (Extending Digimon class) combined.
- Every school will play with all other schools in a round robin fashion. Every encounter with another school is considered a game.
- A game is composed of a minimum of 3 fights and a maximum of 5 fights.
- A game is won by winning 3 fights.
- There will be no coding during July 13, 2013. Matches will be done live by running the codes.
- Coding will commence on July 1, 2013 during the orientation and will end on July 12, 2013 5pm.
- All ten Digimons should have been submitted by July 12, 2013 5pm.
- Digimons will fight against other Digimons on a turn-based system. If the life of all Digimons present in the battle empties out, the participant loses.
- A game is composed of independent fights.
- When a fight is won, a score of 1 is added to the team’s game points.
- The team who first gets 3 points win the game.
- Before a fight begins, the participants select two of the ten Digimons they submitted. This is done without knowing the opponents’ choices.
- They then verify the authenticity of the Digimon files they submitted.
- Of the two Digimons they choose for the fight, they indicate which one is active, and which one is inactive. The active digimon is the first one to combat.
- This is a turn-based game. Teams take turn in executing a move. The system automatically facilitates the changing of turns.
- The active Digimon of every team engages to fight first. The inactive Digimon becomes active once the active Digimon initiates a TAG move or when the currently active Digimon dies.
- There are only 4 possible moves in the fight: ATTACK, MATTACK, HEAL, TAG. Actual codes are provided for the respective functionalities.
- Every turn follows this sequence:
- Check if the Active Digimon is still alive (HP>0). If it is dead, the inactive alive Digimon is switched.
- Regenerate Team (Active: MP+1, Inactive: HP+1, MP+2)
- Execute Move. If the move exceeds 1 second, the move is forfeited.
- Fight Timer is set to 60 seconds.
- The fight is finished when either the timer is down to 0 or when either of the team loses all its team HP (Team HP = 0).
- The team who will cause the System to Loop Infinitely will lose the fight.
The Game
package ph.softartifact.digiwars.data.model;
/**
*
* @author Soft Artifact Incorporated
*/
public abstract class Digimon {
public enum DigiMove {
ATTACK,
MATTACK,
HEAL,
TAG
}
protected DigimonStats digimonStats;
public abstract DigiMove executeTurn();
public void setStats(DigimonStats digimonStats) {
this.digimonStats = digimonStats;
}
}
1. The system runs your executeTurn();
2. And you are to return a DigiMove either: ATTACK, MATTACK, HEAL, TAG. This will be explained.
3. You get a copy of your digimonStats at the start of the fight, so your code should be able to track your own Digimon Stats.
4. You will be fed of both the HP and the MP of the opponent Digimon before your executeTurn is run.
DigimonStats
package ph.softartifact.digiwars.data.model;
import java.math.BigDecimal;
import java.math.RoundingMode;
/**
*
* @author Soft Artifact Incorporated
*/
public class DigimonStats {
private BigDecimal hp;
private BigDecimal mp;
private BigDecimal physicalAttack;
private BigDecimal magicAttack;
private BigDecimal physicalDefense;
private BigDecimal attackAccuracy;
private BigDecimal defenseAccuracy;
/**
* @return the hp
*/
public BigDecimal getHp() {
return hp;
}
/**
* @return the mp
*/
public BigDecimal getMp() {
return mp;
}
/**
* @return the physicalAttack
*/
public BigDecimal getPhysicalAttack() {
return physicalAttack;
}
/**
* @return the magicAttack
*/
public BigDecimal getMagicAttack() {
return magicAttack;
}
/**
* @return the physicalDefense
*/
public BigDecimal getPhysicalDefense() {
return physicalDefense;
}
/**
* @return the attackAccuracy
*/
public BigDecimal getAttackAccuracy() {
return attackAccuracy;
}
/**
* @return the defenseAccuracy
*/
public BigDecimal getDefenseAccuracy() {
return defenseAccuracy;
}
public void hitDigimon(BigDecimal attackPoints) {
hp = hp.subtract(attackPoints);
}
public void initializeStats(int hp, int mp, int physicalAttack, int magicAttack, int physicalDefense, int attackAccuracy, int defenseAccuracy) {
this.hp = BigDecimal.valueOf(hp);
this.mp = BigDecimal.valueOf(hp);
this.physicalAttack = BigDecimal.valueOf(physicalAttack).divide(BigDecimal.valueOf(10), 2, RoundingMode.UP);
this.magicAttack = BigDecimal.valueOf(magicAttack).divide(BigDecimal.valueOf(10), 2, RoundingMode.UP);
this.physicalDefense = BigDecimal.valueOf(physicalDefense).divide(BigDecimal.valueOf(10), 2, RoundingMode.UP);
this.attackAccuracy = BigDecimal.valueOf(attackAccuracy);
this.defenseAccuracy = BigDecimal.valueOf(defenseAccuracy);
}
}
Let me explain to you the seven stats your digimon has:
- HP: Health Points. If this gets <= 0, your digimon dies.
- MP: Magic Points. This gets generated every turn. MP allows you to cast Magic Attacks and Heal.
- Your MP is drained by the same points you render a Magic Attack.
- When you HEAL, your MP is drained completely, and for every MP that is used up, your HP is equivalently replenished.
- Physical Attack: The number of points you can potentially damage your Opponent’s HP
- Magic Attack: The number of points you can damage your Opponent’s HP
- Physical Defense: If after the computation your physical defense is greater than your opponent’s physical attack points, you will be able to completely block that attack.
- Attack Accuracy: Makes for the Uncertainty Variance affecting the final attack points.
- Defense Accuracy: The probability at which your digimon will attempt to block the opponent’s physical attack.
Initialize Stats
At the start of every fight, the participant keys in the initial stats they would like to give to their Digimon.
For every digimon, they only have a maximum of 400 Integer Points Allowed.
For the Physical Attack, Magic Attack, and Physical Defense, the integer are divided by 10, and converted to a BigDecimal value.
Example:
HP: 200
MP: 50
Physical Attack: 100
Magic Attack: 0
Physical Defense: 50
Attack Accuracy: 50
Defense Accuracy: 100
During the initialization stage, the system will only consider the first four 500 points and will discard the rest. This means that this Digimon will only have:
HP: 200
MP: 50
Physical Attack: 100
Magic Attack: 0
Physical Defense: 50
Attack Accuracy: 0
Defense Accuracy: 0
during the fight.
Then, the three stats above will be converted to:
HP: 200
MP: 50
Physical Attack: 10.00
Magic Attack: 0
Physical Defense: 5.00
Attack Accuracy: 0
Defense Accuracy: 0
So, the Digimon will execute its strategy based on the stats it is provided with.
Computation of Attack Points
Given RAND(min, max) function,
1. Physical Attack
Range Normalizer = 1/3(Attack Accuracy);
Range = RAND(0,Attack Accuracy) – Range Normalizer;
Percentage Range = Range / 100;
Physical Damage = Physical Attack * (1 + Percentage Range);
2. Magic Attack
Physical Damage = Magic Attack (if MP >= Magic Attack; MP = MP – Magic Attack);
or
Physical Damage = 0 (if MP < Magic Attack; MP = MP – Magic Attack until MP = 0);
3. Defense
Range = RAND(0,100);
If Range > Defense Accuracy
Defense Status = True
else
Defense Status = False
Therefore:
Block = UNSUCCESSFUL
If Defense Status = True
Block = SUCCESSFUL (If Opponent Physical Damage > Physical Defense)
Block = UNSUCCESSFUL (If Opponent Physical Damage <= Physical Defense)
Move Technicality
If executeTurn() takes more than 1 minute, the digimon move is forfeited and the opponent makes its move.
Leave a Reply