Skip to content

Instantly share code, notes, and snippets.

@MikuAuahDark
Created September 24, 2015 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikuAuahDark/12f33ace8624401cc7c0 to your computer and use it in GitHub Desktop.
Save MikuAuahDark/12f33ace8624401cc7c0 to your computer and use it in GitHub Desktop.
[Php] Effect string from Leader Skill string
<?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