Deity's Body

The Ascended Demigod Statue for Shendao Cultivators. Spawned after ascending (succeeding in their Divinity Tribulation) a Shendao cultivator. Has three production options (rituals) to generate Faith. The Faith is used as a resource for casting special abilities. The counterpart to Xiandao Cultivators Immortal's Mortal Body.

Destroying or demolishing a Deity's Body will always drop 1 Sarira.

Deity's Body will always be None Element Feng Shui Building, with no Qi Gathering.

The name of the Building will contain the name of the Cultivator who ascended. The Image/Model of the building is the Cultivator at time of Ascension. The Building can be relocated.

## Production Options

Deity's Body has three Production Options:

* Ritual of Spirit
	+ A basic ritual of god, with a relatively simple process. Generates 1 Faith. Additional Faith can be generated by using high-level food as offerings in the ritual.
		- Cost of 1 Obsession Gem
		- Additional Cost of 9 Food Items
* Ritual of Heaven
	+ Medium-level ritual of god, which requires the usage of some instruments. Generates 4 Faith. Additional Faith can be generated by using high-level food as offerings in the ritual.
		- Cost of 4 Obsession Gems
		- Additional Cost of 25 Food Items
* Ritual of Veneration
	+ Ritual of god of the highest level, it requires sophisticated instruments and extended prayers. Generates 9 Faith. Additional Faith can be generated by using high-level food as offerings in the ritual.
		- Cost of 9 Obsession Gems
		- Additional Cost of 49 Food Items

### Formula

*See: Formula for Immortal's Mortal Body*

## Special Abilities

The special abilities of a Deity's Body come from the Skill Attribute of a Shendao Law. All Shendao Laws have the same Skill Attribute value:

* `Hufaciyu` - Grant Guard

Grant Guard - Costs 25 faith to grant a guard to the Divine Realm and the cultivator.

### Grant Guard

The ability works by unlocking a random Guard out of all pre-defined Guards.

```
Function Source: XiaWorld.UILogicMode_IndividualCommand.Apply2Thing

```

After decreasing Faith, the function rolls for the Tier range of the Guard.

* 90% Chance of it being 0-6
* 7% Chance of it being 7-11
* 3% Chance of it being 12-15

There is an additional Flag, `g_emNpcSpecailFlag.HufaciyuCount` (often called the Pity Factor by the community), which gets incremented every time the third range isn't selected. When there have been over 9 subsequent uses of the Grant Guard ability without the highest (12-15) range rolled, the tenth use will have the range modified to 12-15 outside of the previous roll (which is where the *pity* terminology comes from).

After the Range has been assigned, the function utilizes `PracticeMgr.RandomGodGuard` to select the Random Guard out of the Tier Range. If there were no guards in that Tier Range, the following message will be added along with 100 000 Belief:

> The guard has not yet descended and probably will not come here.
>
>

If a Guard was in that Tier Range, and its Tier is greater of equal to 12, the `HufaciyuCount` gets reset. The Guard gets unlocked for that Shendao Cultivator, assuming no duplicates of the same type.

If a duplicate exists, the Belief will be added instead, based on the Tier of the Guard.

* Tier 6 and below: 10 000 Belief
* Tier 11-7, 100 000 Belief
* Tier 12 and higher: 500 000 Belief

## Technical

Uses Immortal's Mortal Body as a parent for Inheritance.

ThingDef Name = `Building_YiTui1`