Trigger, Action 역할 재정의
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
|
||||
class None implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = -1;
|
||||
static $name = '-';
|
||||
static $info = '';
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_대의 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 1;
|
||||
static $name = '대의';
|
||||
static $info = '명성 +10%, 훈련 -5';
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
if($statName == 'experience'){
|
||||
return $value * 1.1;
|
||||
}
|
||||
if($statName == 'bonusTrain'){
|
||||
return $value - 5;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_안전 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 9;
|
||||
static $name = '안전';
|
||||
static $info = '사기 -5, 징·모병 비용 -20%';
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value):float{
|
||||
if(in_array($turnType, ['징병', '모병'])){
|
||||
if($varType == 'cost'){
|
||||
return $value * 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
if($statName == 'bonusAtmos'){
|
||||
return $value - 5;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_대의 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 0;
|
||||
static $name = '왕좌';
|
||||
static $info = '명성 +10%, 사기 -5';
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
if($statName == 'experience'){
|
||||
return $value * 1.1;
|
||||
}
|
||||
if($statName == 'bonusAtmos'){
|
||||
return $value - 5;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_유지 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 8;
|
||||
static $name = '안전';
|
||||
static $info = '훈련 -5, 징·모병 비용 -20%';
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value):float{
|
||||
if(in_array($turnType, ['징병', '모병'])){
|
||||
if($varType == 'cost'){
|
||||
return $value * 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
if($statName == 'bonusTrain'){
|
||||
return $value - 5;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_은둔 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 10;
|
||||
static $name = '은둔';
|
||||
static $info = '명성 -10%, 계급 -10%, 사기 -5, 훈련 -5, 단련 성공률 +10%';
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value):float{
|
||||
if($turnType == '단련'){
|
||||
if($varType == 'success'){
|
||||
return $value + 0.1;
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
if($statName == 'bonusAtmos'){
|
||||
return $value - 5;
|
||||
}
|
||||
if($statName == 'bonusTrain'){
|
||||
return $value - 5;
|
||||
}
|
||||
if($statName == 'experience'){
|
||||
return $value * 0.9;
|
||||
}
|
||||
if($statName == 'dedication'){
|
||||
return $value * 0.9;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_의협 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 2;
|
||||
static $name = '의협';
|
||||
static $info = '사기 +5, 징·모병 비용 +20%';
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value):float{
|
||||
if(in_array($turnType, ['징병', '모병'])){
|
||||
if($varType == 'cost'){
|
||||
return $value * 1.2;
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
if($statName == 'bonusAtmos'){
|
||||
return $value + 5;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_재간 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 7;
|
||||
static $name = '재간';
|
||||
static $info = '명성 -10%, 징·모병 비용 -20%';
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value):float{
|
||||
if(in_array($turnType, ['징병', '모병'])){
|
||||
if($varType == 'cost'){
|
||||
return $value * 0.8;
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
if($statName == 'experience'){
|
||||
return $value * 0.9;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_정복 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 4;
|
||||
static $name = '정복';
|
||||
static $info = '명성 -10%, 사기 +5';
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
if($statName == 'experience'){
|
||||
return $value * 0.9;
|
||||
}
|
||||
if($statName == 'bonusAtmos'){
|
||||
return $value + 5;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_출세 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 6;
|
||||
static $name = '출세';
|
||||
static $info = '명성 +10%, 징·모병 비용 +20%';
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value):float{
|
||||
if(in_array($turnType, ['징병', '모병'])){
|
||||
if($varType == 'cost'){
|
||||
return $value * 1.2;
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
if($statName == 'experience'){
|
||||
return $value * 1.1;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_패권 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 3;
|
||||
static $name = '패권';
|
||||
static $info = '훈련 +5, 징·모병 비용 +20%';
|
||||
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value):float{
|
||||
if(in_array($turnType, ['징병', '모병'])){
|
||||
if($varType == 'cost'){
|
||||
return $value * 1.2;
|
||||
}
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
if($statName == 'bonusTrain'){
|
||||
return $value + 5;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace sammo\ActionPersonality;
|
||||
use \sammo\iAction;
|
||||
use \sammo\General;
|
||||
|
||||
class che_할거 implements iAction{
|
||||
use \sammo\DefaultAction;
|
||||
|
||||
static $id = 5;
|
||||
static $name = '할거';
|
||||
static $info = '명성 -10%, 훈련 +5';
|
||||
|
||||
public function onPreGeneralStatUpdate(General $general, string $statName, $value){
|
||||
if($statName == 'experience'){
|
||||
return $value * 0.9;
|
||||
}
|
||||
if($statName == 'bonusTrain'){
|
||||
return $value + 5;
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user