/* Is followed by one or more cc==230 ? */ static UBool isFollowedByMoreAbove(const UCaseProps *csp, UCaseContextIterator *iter, void *context) { UChar32 c; int32_t dotType; int8_t dir; if(iter==NULL) { return FALSE; } for(dir=1; (c=iter(context, dir))>=0; dir=0) { dotType=getDotType(csp, c); if(dotType==UCASE_ABOVE) { return TRUE; /* at least one cc==230 following */ } else if(dotType!=UCASE_OTHER_ACCENT) { return FALSE; /* next base character, no more cc==230 following */ } } return FALSE; /* no more cc==230 following */ }
/* Is preceded by Soft_Dotted character with no intervening cc=230 ? */ static UBool isPrecededBySoftDotted(const UCaseProps *csp, UCaseContextIterator *iter, void *context) { UChar32 c; int32_t dotType; int8_t dir; if(iter==NULL) { return FALSE; } for(dir=-1; (c=iter(context, dir))>=0; dir=0) { dotType=getDotType(csp, c); if(dotType==UCASE_SOFT_DOTTED) { return TRUE; /* preceded by TYPE_i */ } else if(dotType!=UCASE_OTHER_ACCENT) { return FALSE; /* preceded by different base character (not TYPE_i), or intervening cc==230 */ } } return FALSE; /* not preceded by TYPE_i */ }
/* Is followed by a dot above (without cc==230 in between) ? */ static UBool isFollowedByDotAbove(const UCaseProps *csp, UCaseContextIterator *iter, void *context) { UChar32 c; int32_t dotType; int8_t dir; if(iter==NULL) { return FALSE; } for(dir=1; (c=iter(context, dir))>=0; dir=0) { if(c==0x307) { return TRUE; } dotType=getDotType(csp, c); if(dotType!=UCASE_OTHER_ACCENT) { return FALSE; /* next base character or cc==230 in between */ } } return FALSE; /* no dot above following */ }
/* Is preceded by base character 'I' with no intervening cc=230 ? */ static UBool isPrecededBy_I(const UCaseProps *csp, UCaseContextIterator *iter, void *context) { UChar32 c; int32_t dotType; int8_t dir; if(iter==NULL) { return FALSE; } for(dir=-1; (c=iter(context, dir))>=0; dir=0) { if(c==0x49) { return TRUE; /* preceded by I */ } dotType=getDotType(csp, c); if(dotType!=UCASE_OTHER_ACCENT) { return FALSE; /* preceded by different base character (not I), or intervening cc==230 */ } } return FALSE; /* not preceded by I */ }
void WeaponObjectImplementation::fillAttributeList(AttributeListMessage* alm, CreatureObject* object) { TangibleObjectImplementation::fillAttributeList(alm, object); bool res = isCertifiedFor(object); if (res) { alm->insertAttribute("weapon_cert_status", "Yes"); } else { alm->insertAttribute("weapon_cert_status", "No"); } /*if (usesRemaining > 0) alm->insertAttribute("count", usesRemaining);*/ for(int i = 0; i < wearableSkillMods.size(); ++i) { String key = wearableSkillMods.elementAt(i).getKey(); String statname = "cat_skill_mod_bonus.@stat_n:" + key; int value = wearableSkillMods.get(key); if (value > 0) alm->insertAttribute(statname, value); } String ap; switch (armorPiercing) { case NONE: ap = "None"; break; case LIGHT: ap = "Light"; break; case MEDIUM: ap = "Medium"; break; case HEAVY: ap = "Heavy"; break; default: ap = "Unknown"; break; } alm->insertAttribute("wpn_armor_pierce_rating", ap); alm->insertAttribute("wpn_attack_speed", Math::getPrecision(getAttackSpeed(), 1)); if (getDamageRadius() != 0.0f) alm->insertAttribute("area", Math::getPrecision(getDamageRadius(), 0)); //Damage Information StringBuffer dmgtxt; switch (damageType) { case KINETIC: dmgtxt << "Kinetic"; break; case ENERGY: dmgtxt << "Energy"; break; case ELECTRICITY: dmgtxt << "Electricity"; break; case STUN: dmgtxt << "Stun"; break; case BLAST: dmgtxt << "Blast"; break; case HEAT: dmgtxt << "Heat"; break; case COLD: dmgtxt << "Cold"; break; case ACID: dmgtxt << "Acid"; break; case LIGHTSABER: dmgtxt << "Lightsaber"; break; default: dmgtxt << "Unknown"; break; } alm->insertAttribute("damage.wpn_damage_type", dmgtxt); float minDmg = round(getMinDamage()); float maxDmg = round(getMaxDamage()); alm->insertAttribute("damage.wpn_damage_min", minDmg); alm->insertAttribute("damage.wpn_damage_max", maxDmg); StringBuffer woundsratio; float wnd = round(10 * getWoundsRatio()) / 10.0f; woundsratio << wnd << "%"; alm->insertAttribute("damage.wpn_wound_chance", woundsratio); //Accuracy Modifiers StringBuffer pblank; if (getPointBlankAccuracy() >= 0) pblank << "+"; pblank << getPointBlankAccuracy() << " @ " << getPointBlankRange() << "m"; alm->insertAttribute("cat_wpn_rangemods.wpn_range_zero", pblank); StringBuffer ideal; if (getIdealAccuracy() >= 0) ideal << "+"; ideal << getIdealAccuracy() << " @ " << getIdealRange() << "m"; alm->insertAttribute("cat_wpn_rangemods.wpn_range_mid", ideal); StringBuffer maxrange; if (getMaxRangeAccuracy() >= 0) maxrange << "+"; maxrange << getMaxRangeAccuracy() << " @ " << getMaxRange() << "m"; alm->insertAttribute("cat_wpn_rangemods.wpn_range_max", maxrange); //Special Attack Costs alm->insertAttribute("cat_wpn_attack_cost.health", getHealthAttackCost()); alm->insertAttribute("cat_wpn_attack_cost.action", getActionAttackCost()); alm->insertAttribute("cat_wpn_attack_cost.mind", getMindAttackCost()); //Anti Decay Kit if(hasAntiDecayKit()){ alm->insertAttribute("@veteran_new:antidecay_examine_title", "@veteran_new:antidecay_examine_text"); } // Force Cost if (getForceCost() > 0) alm->insertAttribute("forcecost", (int)getForceCost()); for (int i = 0; i < getNumberOfDots(); i++) { String dt; switch (getDotType(i)) { case 1: dt = "Poison"; break; case 2: dt = "Disease"; break; case 3: dt = "Fire"; break; case 4: dt = "Bleeding"; break; default: dt = "Unknown"; break; } StringBuffer type; type << "cat_wpn_dot_0" << i << ".wpn_dot_type"; alm->insertAttribute(type.toString(), dt); String da; switch (getDotAttribute(i)) { case 0: da = "Health"; break; case 1: da = "Strength"; break; case 2: da = "Constitution"; break; case 3: da = "Action"; break; case 4: da = "Quickness"; break; case 5: da = "Stamina"; break; case 6: da = "Mind"; break; case 7: da = "Focus"; break; case 8: da = "Willpower"; break; default: da = "Unknown"; break; } StringBuffer attrib; attrib << "cat_wpn_dot_0" << i << ".wpn_dot_attrib"; alm->insertAttribute(attrib.toString(), da); StringBuffer str; str << "cat_wpn_dot_0" << i << ".wpn_dot_strength"; alm->insertAttribute(str.toString(), getDotStrength(i)); StringBuffer dotDur; dotDur << getDotDuration(i) << "s"; StringBuffer dur; dur << "cat_wpn_dot_0" << i << ".wpn_dot_duration"; alm->insertAttribute(dur.toString(), dotDur); StringBuffer dotPot; dotPot << getDotPotency(i) << "%"; StringBuffer pot; pot << "cat_wpn_dot_0" << i << ".wpn_dot_potency"; alm->insertAttribute(pot.toString(), dotPot); StringBuffer use; use << "cat_wpn_dot_0" << i << ".wpn_dot_uses"; alm->insertAttribute(use.toString(), getDotUses(i)); } if(hasPowerup()) powerupObject->fillWeaponAttributeList(alm, _this.getReferenceUnsafeStaticCast()); if (sliced == 1) alm->insertAttribute("wpn_attr", "@obj_attr_n:hacked1"); }
U_CAPI UBool U_EXPORT2 ucase_isSoftDotted(const UCaseProps *csp, UChar32 c) { return (UBool)(getDotType(csp, c)==UCASE_SOFT_DOTTED); }