Created
September 24, 2015 11:47
-
-
Save MikuAuahDark/12f33ace8624401cc7c0 to your computer and use it in GitHub Desktop.
[Php] Effect string from Leader Skill string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ur_skill_reversemap=[ | |
"Princess" => "Smile", | |
"Angel" => "Pure", | |
"Empress" => "Cool" | |
]; | |
// It expects English center skill. | |
function generate_center_description($str) { | |
global $ur_skill_reversemap; | |
if(preg_match("/(\w+) (\w+)/",$str,$attribute)===false) return null; | |
if(strcmp($attribute[2],"Power")==0) return $attribute[1]." increases slightly"; | |
elseif(strcmp($attribute[2],"Heart")==0) return $attribute[1]." increases"; | |
else { | |
if(strcmp($attribute[1],$ur_skill_reversemap[$attribute[2]])==0) return $attribute[1]." increases drastically"; | |
else return $attribute[1]." increases based on ".$ur_skill_reversemap[$attribute[2]]; | |
} | |
return null; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment