Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
feat: new skills #85
Browse files Browse the repository at this point in the history
  • Loading branch information
MalitsPlus committed Nov 27, 2023
1 parent 7968fd5 commit 725b618
Show file tree
Hide file tree
Showing 16 changed files with 417 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

public class AccumulativeDamageAction extends ActionParameter {

private List<ActionValue> stackValues = new ArrayList<>();
protected List<ActionValue> stackValues = new ArrayList<>();

@Override
protected void childInit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.github.malitsplus.shizurunotes.data.action;

import com.github.malitsplus.shizurunotes.R;
import com.github.malitsplus.shizurunotes.common.I18N;
import com.github.malitsplus.shizurunotes.data.Property;

import java.math.RoundingMode;

public class AccumulativeDamageActionForAllEnemy extends AccumulativeDamageAction {
@Override
public String localizedDetail(int level, Property property) {
return I18N.getString(R.string.Add_additional_s1_damage_per_attack_with_max_s2_stacks_to_current_target_for_all_enemy,
buildExpression(level, property), buildExpression(level, stackValues, RoundingMode.FLOOR, property));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,22 @@ public static ActionParameter type(int rawType){
return new ChangeSpeedOverwriteFieldAction();
case 100:
return new UnableStateGuardAction();
case 101:
return new AttackSealActionForAllEnemy();
case 102:
return new AccumulativeDamageActionForAllEnemy();
case 103:
return new CopyAtkParamAction();
case 104:
return new EveryAttackCriticalAction();
case 105:
return new EnvironmentAction();
case 106:
return new ProtectAction();
case 107:
return new ChangeCriticalReferenceAction();
case 108:
return new IfContainsUnitGroupAction();
default:
return new ActionParameter();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ public String localizedDetail(int level, Property property) {
buildExpression(level, null, RoundingMode.UNNECESSARY, property, false, false, true),
targetParameter.buildTargetClause(), actionDetail2, getActionNum(actionDetail1));
break;
case 15:
result = I18N.getString(R.string.Modifier_add_s1_remnant_of_HP_of_s2_value_d3_of_effect_d4,
buildExpression(level, null, RoundingMode.UNNECESSARY, property, false, false, true),
targetParameter.buildTargetClause(), actionDetail2, getActionNum(actionDetail1));
break;
case 102:
result = I18N.getString(R.string.Modifier_add_s1_count_of_omemes_value_d2_of_effect_d3,
buildExpression(level, null, RoundingMode.UNNECESSARY, property, false, false, true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ enum Condition{
unknown(-1),
damage(1),
target(2),
hit(3),
criticalHit(4);
damageMulti(3),
criticalHit(4),
hit(5);

private int value;
Condition(int value){
Expand Down Expand Up @@ -66,7 +67,7 @@ protected void childInit() {
super.childInit();
condition = Condition.parse(actionDetail1);
target = Target.parse(actionDetail3);
durationValues.add(new ActionValue(actionValue3, actionValue4, null));
durationValues.add(new ActionValue(actionValue5, actionValue6, null));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.github.malitsplus.shizurunotes.data.action;

import com.github.malitsplus.shizurunotes.R;
import com.github.malitsplus.shizurunotes.common.I18N;
import com.github.malitsplus.shizurunotes.data.Property;
import com.github.malitsplus.shizurunotes.utils.Utils;

import java.math.RoundingMode;

public class AttackSealActionForAllEnemy extends AttackSealAction {
@Override
public String localizedDetail(int level, Property property) {
if(condition == Condition.hit)
return I18N.getString(R.string.Make_s1_when_get_one_hit_by_the_caster_gain_one_mark_stack_max_s2_ID_s3_for_s4_sec_for_all_enemy,
targetParameter.buildTargetClause(),
Utils.roundDownDouble(actionValue1.value),
Utils.roundDownDouble(actionValue2.value),
buildExpression(level, durationValues, RoundingMode.UNNECESSARY, property));
else if(condition == Condition.damage && target == Target.owner)
return I18N.getString(R.string.Make_s1_when_deal_damage_gain_one_mark_stack_max_s2_ID_s3_for_s4_sec_for_all_enemy,
targetParameter.buildTargetClause(),
Utils.roundDownDouble(actionValue1.value),
Utils.roundDownDouble(actionValue2.value),
buildExpression(level, durationValues, RoundingMode.UNNECESSARY, property));
else if(condition == Condition.criticalHit && target == Target.owner)
return I18N.getString(R.string.Make_s1_when_deal_critical_damage_gain_one_mark_stack_max_s2_ID_s3_for_s4_sec_for_all_enemy,
targetParameter.buildTargetClause(),
Utils.roundDownDouble(actionValue1.value),
Utils.roundDownDouble(actionValue2.value),
buildExpression(level, durationValues, RoundingMode.UNNECESSARY, property));
else
return super.localizedDetail(level, property);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.github.malitsplus.shizurunotes.data.action;

import com.github.malitsplus.shizurunotes.R;
import com.github.malitsplus.shizurunotes.common.I18N;
import com.github.malitsplus.shizurunotes.data.Property;

public class ChangeCriticalReferenceAction extends ActionParameter {

enum CriticalReferenceType{
unknown(-1),
normal(1),
physicalCrit(2),
magicCrit(3),
sumCrit(4);

private int value;
CriticalReferenceType(int value){
this.value = value;
}
public int getValue(){
return value;
}

public static CriticalReferenceType parse(int value){
for(CriticalReferenceType item : CriticalReferenceType.values()){
if(item.getValue() == value)
return item;
}
return unknown;
}

public String description() {
switch (this) {
case normal: return I18N.getString(R.string.normal);
case physicalCrit: return I18N.getString(R.string.Physical_Critical);
case magicCrit: return I18N.getString(R.string.Magic_Critical);
case sumCrit: return I18N.getString(R.string.Sum_of_phy_and_mag);
}
return I18N.getString(R.string.unknown);
}
}

protected CriticalReferenceType referenceType;

@Override
protected void childInit() {
super.childInit();
referenceType = CriticalReferenceType.parse(actionDetail2);
}

@Override
public String localizedDetail(int level, Property property) {
if (referenceType == CriticalReferenceType.normal) {
return I18N.getString(R.string.no_effect);
}
return I18N.getString(R.string.Use_critical_reference_s1_for_skill_d2,
referenceType.description(),
getActionNum(actionDetail1)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.github.malitsplus.shizurunotes.data.action;

import com.github.malitsplus.shizurunotes.R;
import com.github.malitsplus.shizurunotes.common.I18N;
import com.github.malitsplus.shizurunotes.data.Property;

public class CopyAtkParamAction extends ActionParameter {

enum AtkType{
atk(1),
magicStr(2);

private int value;
AtkType(int value){
this.value = value;
}
public int getValue(){
return value;
}

public static AtkType parse(int value){
for(AtkType item : AtkType.values()){
if(item.getValue() == value)
return item;
}
return atk;
}

public String description() {
switch (this) {
case atk: return I18N.getString(R.string.ATK);
case magicStr: return I18N.getString(R.string.Magic_STR);
}
return I18N.getString(R.string.unknown);
}
}

protected AtkType atkType;

@Override
protected void childInit() {
super.childInit();
atkType = AtkType.parse(actionDetail1);
}

@Override
public String localizedDetail(int level, Property property) {
return I18N.getString(R.string.Use_param_s1_of_s2_for_action_d3,
atkType.description(),
targetParameter.buildTargetClause(),
getActionNum(actionDetail2)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.github.malitsplus.shizurunotes.data.action;

import com.github.malitsplus.shizurunotes.R;
import com.github.malitsplus.shizurunotes.common.I18N;
import com.github.malitsplus.shizurunotes.data.Property;

import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;

public class EnvironmentAction extends ActionParameter {

public enum EnvironmentType{
unknown(-1),
thundering(137);

private int value;
EnvironmentType(int value){
this.value = value;
}
public int getValue(){
return value;
}

public static EnvironmentType parse(int value){
for(EnvironmentType item : EnvironmentType.values()){
if(item.getValue() == value)
return item;
}
return unknown;
}

public String description() {
switch (this) {
case thundering: return I18N.getString(R.string.thundering);
}
return I18N.getString(R.string.unknown);
}
}

protected EnvironmentType environmentType;
protected List<ActionValue> durationValues = new ArrayList<>();

@Override
protected void childInit() {
super.childInit();
environmentType = EnvironmentType.parse(actionDetail2);
durationValues.add(new ActionValue(actionValue1, actionValue2, null));
}

@Override
public String localizedDetail(int level, Property property) {
return I18N.getString(R.string.Summon_a_field_of_s1_environment_for_s2_for_s3_sec,
environmentType.description(),
targetParameter.buildTargetClause(),
buildExpression(level, durationValues, RoundingMode.UNNECESSARY, property)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package com.github.malitsplus.shizurunotes.data.action;

import com.github.malitsplus.shizurunotes.R;
import com.github.malitsplus.shizurunotes.common.I18N;
import com.github.malitsplus.shizurunotes.data.Property;

import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;

public class EveryAttackCriticalAction extends ActionParameter {
enum CriticalType{
physical(1),
magical(2),
both(3);

private int value;
CriticalType(int value){
this.value = value;
}
public int getValue(){
return value;
}

public static CriticalType parse(int value){
for(CriticalType item : CriticalType.values()){
if(item.getValue() == value)
return item;
}
return physical;
}

public String description() {
switch (this) {
case physical: return I18N.getString(R.string.physical);
case magical: return I18N.getString(R.string.magical);
case both: return I18N.getString(R.string.both);
}
return I18N.getString(R.string.unknown);
}
}

protected CriticalType criticalType;
protected List<ActionValue> durationValues = new ArrayList<>();

@Override
protected void childInit() {
super.childInit();
criticalType = CriticalType.parse(actionDetail1);
durationValues.add(new ActionValue(actionValue1, actionValue2, null));
}

@Override
public String localizedDetail(int level, Property property) {
return I18N.getString(R.string.Make_s1_dmg_dealt_by_self_promised_to_get_critical_for_s2_sec,
criticalType.description(),
buildExpression(level, durationValues, RoundingMode.UNNECESSARY, property)
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.github.malitsplus.shizurunotes.data.action;

import com.github.malitsplus.shizurunotes.R;
import com.github.malitsplus.shizurunotes.common.I18N;
import com.github.malitsplus.shizurunotes.data.Property;

public class IfContainsUnitGroupAction extends ActionParameter {
@Override
protected void childInit() {
super.childInit();
}

@Override
public String localizedDetail(int level, Property property) {
return I18N.getString(R.string.Enabled_if_s1_in_group_d2_or_d3,
targetParameter.buildTargetClause(true),
actionDetail1,
actionDetail2
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ protected void childInit() {
} else if(actionDetail1 >= 6000 && actionDetail1 < 7000) {
trueClause = I18N.getString(R.string.use_d1_if_s2_is_in_state_of_ID_d3_with_stacks_greater_than_or_equal_to_d4,
getActionNum(actionDetail2), targetParameter.buildTargetClause(true), actionDetail1 - 6000, (int)actionValue3.value);
} else if(actionDetail1 >= 3000 && actionDetail1 < 4000) {
trueClause = I18N.getString(R.string.Performs_action_d1_in_case_of_the_battle_field_is_covered_by_s2,
getActionNum(actionDetail2),
EnvironmentAction.EnvironmentType.parse(actionDetail1 - 3000).description()
);
}
} else if (actionDetail3 == 0){
trueClause = I18N.getString(R.string.no_effect);
Expand Down Expand Up @@ -122,6 +127,11 @@ protected void childInit() {
} else if(actionDetail1 >= 6000 && actionDetail1 < 7000) {
falseClause = I18N.getString(R.string.use_d1_if_s2_is_not_in_state_of_ID_d3_with_stacks_greater_than_or_equal_to_d4,
getActionNum(actionDetail3), targetParameter.buildTargetClause(true), actionDetail1 - 6000, (int)actionValue3.value);
} else if(actionDetail1 >= 3000 && actionDetail1 < 4000) {
falseClause = I18N.getString(R.string.Performs_action_d1_in_case_of_the_battle_field_is_not_covered_by_s2,
getActionNum(actionDetail3),
EnvironmentAction.EnvironmentType.parse(actionDetail1 - 3000).description()
);
}
} else if (actionDetail2 == 0){
falseClause = I18N.getString(R.string.no_effect);
Expand Down
Loading

0 comments on commit 725b618

Please sign in to comment.