Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Physical Only Damage
- <Custom React Effect>
- // Check if the damage is positive and if it's a physical action.
- if (value > 0 && this.isPhysical()) {
- // Get the living members of the same party.
- var members = target.friendsUnit().aliveMembers();
- // Make an empty group to list affected members.
- var affected = [];
- // We'll go through each member to check them.
- for (var i = 0; i < members.length; ++i) {
- // Getting the individual member.
- var member = members[i];
- // Does the member exist and is the member affected by state 91 (the Joint Penalty state)?
- if (member && member.isStateAffected(91)) {
- // If the member is affected, add it to the affected group.
- affected.push(member);
- }
- }
- // Divide up the damage by how many members are affected.
- value = Math.ceil(value / affected.length);
- // We'll go through each of the affected members now.
- for (var i = 0; i < affected.length; ++i) {
- // Getting the individual affected member.
- var member = affected[i];
- // Ignore the effect if the member is the target of attack.
- if (member !== target) {
- // Let's play animation 12 on the affected member.
- member.startAnimation(12);
- // The affected member takes damage.
- member.gainHp(-value);
- // We'll have the affected member reveal a damage popup.
- member.startDamagePopup();
- // Clear the results of the effect.
- member.clearResult();
- // Next, check to see if the member is dead.
- if (member.isDead()) {
- // If the member is dead, we'll make it collapse.
- member.performCollapse();
- }
- }
- }
- }
- </Custom React Effect>
- Magical Only Damage
- <Custom React Effect>
- // Check if the damage is positive and if it's a magical action.
- if (value > 0 && this.isMagical()) {
- // Get the living members of the same party.
- var members = target.friendsUnit().aliveMembers();
- // Make an empty group to list affected members.
- var affected = [];
- // We'll go through each member to check them.
- for (var i = 0; i < members.length; ++i) {
- // Getting the individual member.
- var member = members[i];
- // Does the member exist and is the member affected by state 91 (the Joint Penalty state)?
- if (member && member.isStateAffected(91)) {
- // If the member is affected, add it to the affected group.
- affected.push(member);
- }
- }
- // Divide up the damage by how many members are affected.
- value = Math.ceil(value / affected.length);
- // We'll go through each of the affected members now.
- for (var i = 0; i < affected.length; ++i) {
- // Getting the individual affected member.
- var member = affected[i];
- // Ignore the effect if the member is the target of attack.
- if (member !== target) {
- // Let's play animation 12 on the affected member.
- member.startAnimation(12);
- // The affected member takes damage.
- member.gainHp(-value);
- // We'll have the affected member reveal a damage popup.
- member.startDamagePopup();
- // Clear the results of the effect.
- member.clearResult();
- // Next, check to see if the member is dead.
- if (member.isDead()) {
- // If the member is dead, we'll make it collapse.
- member.performCollapse();
- }
- }
- }
- }
- </Custom React Effect>
- Certain-Hit Only Damage
- <Custom React Effect>
- // Check if the damage is positive and if it's a certain hit action.
- if (value > 0 && this.isCertainHit()) {
- // Get the living members of the same party.
- var members = target.friendsUnit().aliveMembers();
- // Make an empty group to list affected members.
- var affected = [];
- // We'll go through each member to check them.
- for (var i = 0; i < members.length; ++i) {
- // Getting the individual member.
- var member = members[i];
- // Does the member exist and is the member affected by state 91 (the Joint Penalty state)?
- if (member && member.isStateAffected(91)) {
- // If the member is affected, add it to the affected group.
- affected.push(member);
- }
- }
- // Divide up the damage by how many members are affected.
- value = Math.ceil(value / affected.length);
- // We'll go through each of the affected members now.
- for (var i = 0; i < affected.length; ++i) {
- // Getting the individual affected member.
- var member = affected[i];
- // Ignore the effect if the member is the target of attack.
- if (member !== target) {
- // Let's play animation 12 on the affected member.
- member.startAnimation(12);
- // The affected member takes damage.
- member.gainHp(-value);
- // We'll have the affected member reveal a damage popup.
- member.startDamagePopup();
- // Clear the results of the effect.
- member.clearResult();
- // Next, check to see if the member is dead.
- if (member.isDead()) {
- // If the member is dead, we'll make it collapse.
- member.performCollapse();
- }
- }
- }
- }
- </Custom React Effect>
- All Damage
- <Custom React Effect>
- // Check if the damage is positive.
- if (value > 0) {
- // Get the living members of the same party.
- var members = target.friendsUnit().aliveMembers();
- // Make an empty group to list affected members.
- var affected = [];
- // We'll go through each member to check them.
- for (var i = 0; i < members.length; ++i) {
- // Getting the individual member.
- var member = members[i];
- // Does the member exist and is the member affected by state 91 (the Joint Penalty state)?
- if (member && member.isStateAffected(91)) {
- // If the member is affected, add it to the affected group.
- affected.push(member);
- }
- }
- // Divide up the damage by how many members are affected.
- value = Math.ceil(value / affected.length);
- // We'll go through each of the affected members now.
- for (var i = 0; i < affected.length; ++i) {
- // Getting the individual affected member.
- var member = affected[i];
- // Ignore the effect if the member is the target of attack.
- if (member !== target) {
- // Let's play animation 12 on the affected member.
- member.startAnimation(12);
- // The affected member takes damage.
- member.gainHp(-value);
- // We'll have the affected member reveal a damage popup.
- member.startDamagePopup();
- // Clear the results of the effect.
- member.clearResult();
- // Next, check to see if the member is dead.
- if (member.isDead()) {
- // If the member is dead, we'll make it collapse.
- member.performCollapse();
- }
- }
- }
- }
- </Custom React Effect>
Advertisement
Add Comment
Please, Sign In to add comment