import React from "react";
import "./Body.css"

function Body() {
    return (
        <>
            <main>
                <section id="introduction">
                    <a href="https://en.wikipedia.org/wiki/Dying_Light" target="_blank"><h2>Introduction</h2></a>
                    <p>
                        Dying Light is a 2015 survival horror video game developed by Techland and published by Warner Bros. Interactive Entertainment. The game's story follows undercover agent Kyle Crane who is sent to infiltrate a quarantine zone in a fictional Middle Eastern city called Harran. It features an enemy-infested, open world city with a dynamic day–night cycle, in which zombies are slow and clumsy during daytime and extremely aggressive at night. The gameplay is focused on weapons-based combat and parkour, allowing players to choose fight or flight when presented with dangers. The game features an asymmetrical multiplayer mode (originally set to be a pre-order bonus), and a four-player co-operative multiplayer mode.
                    </p>
                    <p>
                        The development of the game began in early 2012, after the team completed the development of Dead Island. The game's parkour system emphasizes natural movement. To implement that, Techland had to abandon most of the story elements and construct them again from scratch. To create a story that would suit the taste of the American audience, the writing team collaborated with Dan Jolley. The story was inspired by both Heart of Darkness and The Plague. Announced in May 2013, it was released in January 2015 for Linux, PlayStation 4, Windows, and Xbox One. The game was planned to be released on PlayStation 3 and Xbox 360, but these versions were cancelled due to hardware limitations.
                    </p>
                </section>
                <section id="gameplay">
                    <a href="https://en.wikipedia.org/wiki/Dying_Light" target="_blank"><h2>Gameplay</h2></a>
                    <p>
                        Dying Light is a survival horror video game played from a first-person perspective. The game is set in an open world environment called Harran; initially, an area named the Slums can be freely explored, later adding a second area, accessible via sewers, called Old Town. Players traverse this urban environment, which is overrun by zombies. There is an emphasis on parkour mechanics, which allow players to perform actions such as climbing ledges, leaping from edges, sliding, jumping between roofs and zip-lining. A grappling hook allows players to climb up buildings and quickly travel between places. As players explore the game's world, they can scavenge supplies and loot, which can be used to craft new weapons or sold to vendors. The player character can utilise his "survivor sense" to identify all nearby loot and use lock picks to open locked chests and locked vehicles. Players can also complete various side missions by accepting tasks issued by the non-playable characters in the game's safe zones. As players explore Harran, they can also pick up various collectibles such as notes and journals, and listen to voice mail recordings.
                    </p>
                    <p>
                        Dying Light contains a dynamic day–night cycle. During the day, players can set traps, save random survivors, and make their way to airdrops. The infected are slow, apathetic, and easily visible and they can be easily avoided. Players can use environmental traps, such as spikes, electrified fences, and gas tanks, to kill the infected. At night, the infected transform to become much more dangerous. Without daylight, the senses of the infected become more acute and accurate. They can sprint after the player character, inflict more damage, and gain the ability to jump and climb buildings. For players to avoid contact, they need to use their "survivor sense" to locate and avoid the infected. If the player character is spotted, they can use distractions and traps to reduce the number of infected. Players' main defence against the infected is ultraviolet light, which slows their movement. At safehouses, players can adjust the time of day, skipping night altogether if the player does not feel ready.
                    </p>
                </section>
                <section id="about-characters">
                    <a href="https://dyinglight.fandom.com/wiki/Category:Characters" target="_blank"><h2>About characters</h2></a>
                    <table>
                        <tr>
                            <th>Name</th>
                            <th>Information</th>
                        </tr>
                        <tr>
                            <td>Kyle Crane</td>
                            <td>
                                Kyle Crane is the protagonist of Dying Light, Dying Light: The Following, and Dying Light: The Beast, and is mentioned in Dying Light 2 Stay Human.

                                He was voiced by Roger Craig Smith.
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Kadir Suleiman (Rais)
                            </td>
                            <td>
                                Kadir Suleiman, better known as Rais, is a main character featured in Dying Light, serving as the primary antagonist.
                            </td>
                        </tr>
                    </table>
                </section>
                <section id="random-weapons">
                    <a href="https://dyinglight.fandom.com/wiki/Weapons_(Dying_Light)" target="_blank"><h2>Random weapons</h2></a>
                    <button onClick={() => revealWeapon()}>Reveal a random weapon</button>
                    <div id="show-random-weapon"></div>
                </section>
            </main>
        </>
    )
}

function revealWeapon() {
    const randomArray = ["../weapon1.png", "../weapon2.png", "../weapon3.png"]

    let randomWeaponDiv = document.getElementById("show-random-weapon")
    randomWeaponDiv.innerHTML = ""
    
    let img = document.createElement("img")
    img.src = randomArray[Math.floor(Math.random() * 3)]
    randomWeaponDiv.appendChild(img)
}

export default Body