mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Spells/Tooltips
* fixed parser for lastValue/gender-switch (previous pattern matched against that too) * also its a stupid idea to replace a var with itself
This commit is contained in:
@@ -823,21 +823,21 @@ class SpellList extends BaseType
|
|||||||
'switch' => null
|
'switch' => null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// last value or gender -switch $[lg]ifText:elseText;
|
||||||
|
if (preg_match('/^([lg])([^:]*:[^;]*);/i', $varString, $m))
|
||||||
|
{
|
||||||
|
$len = strlen($m[0]);
|
||||||
|
$varParts['var'] = $m[1];
|
||||||
|
$varParts['switch'] = explode(':', $m[2]);
|
||||||
|
}
|
||||||
// basic variable ref (most common case) $(refSpell)?(var)(effIdx)?
|
// basic variable ref (most common case) $(refSpell)?(var)(effIdx)?
|
||||||
if (preg_match('/^(\d*)([a-z])([123]?)\b/i', $varString, $m))
|
else if (preg_match('/^(\d*)([a-z])([123]?)\b/i', $varString, $m))
|
||||||
{
|
{
|
||||||
$len = strlen($m[0]);
|
$len = strlen($m[0]);
|
||||||
$varParts['lookup'] = $m[1];
|
$varParts['lookup'] = $m[1];
|
||||||
$varParts['var'] = $m[2];
|
$varParts['var'] = $m[2];
|
||||||
$varParts['effIdx'] = $m[3];
|
$varParts['effIdx'] = $m[3];
|
||||||
}
|
}
|
||||||
// last value or gender -switch $[lg]ifText:elseText;
|
|
||||||
else if (preg_match('/^([lg])([^:]*:[^;]*);/i', $varString, $m))
|
|
||||||
{
|
|
||||||
$len = strlen($m[0]);
|
|
||||||
$varParts['var'] = $m[1];
|
|
||||||
$varParts['switch'] = explode(':', $m[2]);
|
|
||||||
}
|
|
||||||
// variable ref /w formula $( (op) (oparg); )? (refSpell) ( (var) (effIdx) ) OR $(refSpell) ( (op) (oparg); )? ( (var) (effIdx) )
|
// variable ref /w formula $( (op) (oparg); )? (refSpell) ( (var) (effIdx) ) OR $(refSpell) ( (op) (oparg); )? ( (var) (effIdx) )
|
||||||
else if (preg_match('/^(([\+\-\*\/])(\d+);)?(\d*)(([\+\-\*\/])(\d+);)?([a-z])([123]?)\b/i', $varString, $m))
|
else if (preg_match('/^(([\+\-\*\/])(\d+);)?(\d*)(([\+\-\*\/])(\d+);)?([a-z])([123]?)\b/i', $varString, $m))
|
||||||
{
|
{
|
||||||
@@ -857,11 +857,11 @@ class SpellList extends BaseType
|
|||||||
|
|
||||||
// description-, buff-parsing component
|
// description-, buff-parsing component
|
||||||
// returns [min, max, minFulltext, maxFulltext, ratingId]
|
// returns [min, max, minFulltext, maxFulltext, ratingId]
|
||||||
private function resolveVariableString($var, &$usesScalingRating)
|
private function resolveVariableString($varParts, &$usesScalingRating)
|
||||||
{
|
{
|
||||||
$signs = ['+', '-', '/', '*', '%', '^'];
|
$signs = ['+', '-', '/', '*', '%', '^'];
|
||||||
|
|
||||||
foreach ($var as $k => $v)
|
foreach ($varParts as $k => $v)
|
||||||
$$k = $v;
|
$$k = $v;
|
||||||
|
|
||||||
$result = [null];
|
$result = [null];
|
||||||
|
|||||||
Reference in New Issue
Block a user